Average Error: 33.1 → 31.9
Time: 2.1m
Precision: 64
Internal Precision: 4160
\[\sqrt{1 + \frac{x - y}{\sqrt{p \cdot x + {\left(x - y\right)}^{2}}}}\]
\[\begin{array}{l} \mathbf{if}\;y \le 9.863786544707671 \cdot 10^{+178}:\\ \;\;\;\;\sqrt{1 + \frac{x - y}{\sqrt{\sqrt{p \cdot x + {\left(x - y\right)}^{2}}} \cdot \sqrt{\sqrt{p \cdot x + {\left(x - y\right)}^{2}}}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 + \frac{x - y}{y - x}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus p

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if y < 9.863786544707671e+178

    1. Initial program 30.8

      \[\sqrt{1 + \frac{x - y}{\sqrt{p \cdot x + {\left(x - y\right)}^{2}}}}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt30.8

      \[\leadsto \sqrt{1 + \frac{x - y}{\sqrt{\color{blue}{\sqrt{p \cdot x + {\left(x - y\right)}^{2}} \cdot \sqrt{p \cdot x + {\left(x - y\right)}^{2}}}}}}\]
    4. Applied sqrt-prod30.9

      \[\leadsto \sqrt{1 + \frac{x - y}{\color{blue}{\sqrt{\sqrt{p \cdot x + {\left(x - y\right)}^{2}}} \cdot \sqrt{\sqrt{p \cdot x + {\left(x - y\right)}^{2}}}}}}\]

    if 9.863786544707671e+178 < y

    1. Initial program 59.9

      \[\sqrt{1 + \frac{x - y}{\sqrt{p \cdot x + {\left(x - y\right)}^{2}}}}\]
    2. Taylor expanded around 0 42.8

      \[\leadsto \sqrt{1 + \frac{x - y}{\color{blue}{y - x}}}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 2.1m)Debug log

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