Average Error: 30.1 → 23.7
Time: 9.4s
Precision: 64
Internal Precision: 320
\[\sqrt{{x}^{2} + {y}^{2}}\]
\[\begin{array}{l} \mathbf{if}\;y \le 4.237569463688917 \cdot 10^{+122}:\\ \;\;\;\;\sqrt{{x}^{2} + {y}^{2}}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if y < 4.237569463688917e+122

    1. Initial program 26.3

      \[\sqrt{{x}^{2} + {y}^{2}}\]

    if 4.237569463688917e+122 < y

    1. Initial program 52.0

      \[\sqrt{{x}^{2} + {y}^{2}}\]
    2. Taylor expanded around 0 8.2

      \[\leadsto \color{blue}{y}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 9.4s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (x y)
  :name "sqrt(x^2+y^2)"
  (sqrt (+ (pow x 2) (pow y 2))))