From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id 15A593858416 for ; Fri, 3 Dec 2021 19:44:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 15A593858416 Received: by mail-qt1-x836.google.com with SMTP id q14so4429574qtx.10 for ; Fri, 03 Dec 2021 11:44:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=/BxUPrswni5UyWLSiRNz2B85erI41pPx3t6eqCRY+ng=; b=w2X/IkNLJ3h1Kod8g3Pb95vkImeDc+6WDniHikk6dqi7hys1wcnyRkpKceBIiaulcp nM9PWnTGoo7CN5/jOmbRZdjsQHj6YJ/OIyvKdLjgkvceWKJ4u+y3LawS8Xj9ZDRdJZIJ /nVZDdmlBco7hb+rbFGmpcd4j90RjeLHdsS7lvaKEMRU9eKT2DnDoXRoIohWUIS9rtwW VX9LnGfWWV/Xni8yWMkRGpYuq1tCS5xWs8PuCnkfTOUNOU766S1eVNZ+eFNrKWZK1Djr Y4226n8KordUuPuqPvMzE0TfvyBzO06D/qKyPrlpPOzjxjbDDecFH9gsyduoScxDfaFW YkSQ== X-Gm-Message-State: AOAM5336j4CpLnB/avBw/NcTtMLWaiPIdX17yg/scnxWbv3erHo2Goku GNP3KnFEwHNH3OYB5mVsCKRbgQ== X-Google-Smtp-Source: ABdhPJycoD6t4klrZdwgCZctBF5zNBhtB+rpYsJOB+Mfm+wxsf88kUSrh7zOG7uZI/2SvxzspmYBYQ== X-Received: by 2002:a05:622a:174b:: with SMTP id l11mr22973455qtk.292.1638560658666; Fri, 03 Dec 2021 11:44:18 -0800 (PST) Received: from ?IPV6:2804:431:c7cb:30f8:f5d6:4b6d:fe6a:d565? ([2804:431:c7cb:30f8:f5d6:4b6d:fe6a:d565]) by smtp.gmail.com with ESMTPSA id w10sm2870704qkp.121.2021.12.03.11.44.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Dec 2021 11:44:18 -0800 (PST) Message-ID: <06d56547-46ef-2397-4669-4724acc4a5f4@linaro.org> Date: Fri, 3 Dec 2021 16:44:16 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH v4 02/12] math: Use an improved algorithm for hypot (dbl-64) Content-Language: en-US To: Wilco Dijkstra , "libc-alpha@sourceware.org" , Paul Zimmermann References: <20211203000103.737833-1-adhemerval.zanella@linaro.org> <20211203000103.737833-3-adhemerval.zanella@linaro.org> From: Adhemerval Zanella In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2021 19:44:20 -0000 On 03/12/2021 10:41, Wilco Dijkstra wrote: > Hi Adhemeval, > > +  /* If ax is huge, scale both inputs down.  */ > +  if (__glibc_unlikely (ax > LARGE_VAL)) >      { > +      if (__glibc_unlikely (ay <= ax * EPS)) > +       return ax + ay; > + > +      return kernel (ax * SCALE, ay * SCALE) / SCALE; >      } > > Both of these returns can overflow and thus should have a math_narrow_eval > (only the case where we can't overflow or underflow doesn't). OK with that change. Ack.