Average Error: 24.8 → 7.3
Time: 4.7s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -6.7050069327788126 \cdot 10^{76}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 6.2711743111954205 \cdot 10^{136}:\\ \;\;\;\;x \cdot \left(\left(y \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 1\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \le -6.7050069327788126 \cdot 10^{76}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 6.2711743111954205 \cdot 10^{136}:\\
\;\;\;\;x \cdot \left(\left(y \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 1\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r266347 = x;
        double r266348 = y;
        double r266349 = r266347 * r266348;
        double r266350 = z;
        double r266351 = r266349 * r266350;
        double r266352 = r266350 * r266350;
        double r266353 = t;
        double r266354 = a;
        double r266355 = r266353 * r266354;
        double r266356 = r266352 - r266355;
        double r266357 = sqrt(r266356);
        double r266358 = r266351 / r266357;
        return r266358;
}

double f(double x, double y, double z, double t, double a) {
        double r266359 = z;
        double r266360 = -6.705006932778813e+76;
        bool r266361 = r266359 <= r266360;
        double r266362 = -1.0;
        double r266363 = x;
        double r266364 = y;
        double r266365 = r266363 * r266364;
        double r266366 = r266362 * r266365;
        double r266367 = 6.27117431119542e+136;
        bool r266368 = r266359 <= r266367;
        double r266369 = r266364 * r266359;
        double r266370 = 1.0;
        double r266371 = r266359 * r266359;
        double r266372 = t;
        double r266373 = a;
        double r266374 = r266372 * r266373;
        double r266375 = r266371 - r266374;
        double r266376 = sqrt(r266375);
        double r266377 = r266370 / r266376;
        double r266378 = r266369 * r266377;
        double r266379 = r266363 * r266378;
        double r266380 = r266365 * r266370;
        double r266381 = r266368 ? r266379 : r266380;
        double r266382 = r266361 ? r266366 : r266381;
        return r266382;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original24.8
Target7.9
Herbie7.3
\[\begin{array}{l} \mathbf{if}\;z \lt -3.1921305903852764 \cdot 10^{46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.9762681209208942 \cdot 10^{90}:\\ \;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if z < -6.705006932778813e+76

    1. Initial program 41.0

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity41.0

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{1 \cdot \left(z \cdot z - t \cdot a\right)}}}\]
    4. Applied sqrt-prod41.0

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\sqrt{1} \cdot \sqrt{z \cdot z - t \cdot a}}}\]
    5. Applied times-frac38.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified38.1

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied associate-*l*38.1

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    9. Using strategy rm
    10. Applied add-sqr-sqrt38.1

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\sqrt{\color{blue}{\sqrt{z \cdot z - t \cdot a} \cdot \sqrt{z \cdot z - t \cdot a}}}}\right)\]
    11. Applied sqrt-prod38.2

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\color{blue}{\sqrt{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt{z \cdot z - t \cdot a}}}}\right)\]
    12. Applied add-cube-cbrt38.4

      \[\leadsto x \cdot \left(y \cdot \frac{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}{\sqrt{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt{z \cdot z - t \cdot a}}}\right)\]
    13. Applied times-frac38.4

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\right)}\right)\]
    14. Applied associate-*r*38.6

      \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\right)}\]
    15. Taylor expanded around -inf 2.9

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)}\]

    if -6.705006932778813e+76 < z < 6.27117431119542e+136

    1. Initial program 11.0

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity11.0

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{1 \cdot \left(z \cdot z - t \cdot a\right)}}}\]
    4. Applied sqrt-prod11.0

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\sqrt{1} \cdot \sqrt{z \cdot z - t \cdot a}}}\]
    5. Applied times-frac9.4

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified9.4

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied associate-*l*9.2

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    9. Using strategy rm
    10. Applied div-inv9.3

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(z \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)}\right)\]
    11. Applied associate-*r*10.6

      \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)}\]

    if 6.27117431119542e+136 < z

    1. Initial program 50.5

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity50.5

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{1 \cdot \left(z \cdot z - t \cdot a\right)}}}\]
    4. Applied sqrt-prod50.5

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\sqrt{1} \cdot \sqrt{z \cdot z - t \cdot a}}}\]
    5. Applied times-frac49.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified49.1

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Taylor expanded around inf 1.7

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{1}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification7.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -6.7050069327788126 \cdot 10^{76}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 6.2711743111954205 \cdot 10^{136}:\\ \;\;\;\;x \cdot \left(\left(y \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 1\\ \end{array}\]

Reproduce

herbie shell --seed 2020062 +o rules:numerics
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))