Average Error: 24.2 → 6.2
Time: 7.8s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -8.6183547901220424 \cdot 10^{153}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 6.9260668882011419 \cdot 10^{147}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \le -8.6183547901220424 \cdot 10^{153}:\\
\;\;\;\;-x \cdot y\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r66330 = x;
        double r66331 = y;
        double r66332 = r66330 * r66331;
        double r66333 = z;
        double r66334 = r66332 * r66333;
        double r66335 = r66333 * r66333;
        double r66336 = t;
        double r66337 = a;
        double r66338 = r66336 * r66337;
        double r66339 = r66335 - r66338;
        double r66340 = sqrt(r66339);
        double r66341 = r66334 / r66340;
        return r66341;
}

double f(double x, double y, double z, double t, double a) {
        double r66342 = z;
        double r66343 = -8.618354790122042e+153;
        bool r66344 = r66342 <= r66343;
        double r66345 = x;
        double r66346 = y;
        double r66347 = r66345 * r66346;
        double r66348 = -r66347;
        double r66349 = 6.926066888201142e+147;
        bool r66350 = r66342 <= r66349;
        double r66351 = r66342 * r66342;
        double r66352 = t;
        double r66353 = a;
        double r66354 = r66352 * r66353;
        double r66355 = r66351 - r66354;
        double r66356 = sqrt(r66355);
        double r66357 = r66342 / r66356;
        double r66358 = r66345 * r66357;
        double r66359 = r66346 * r66358;
        double r66360 = r66350 ? r66359 : r66347;
        double r66361 = r66344 ? r66348 : r66360;
        return r66361;
}

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.2
Target7.7
Herbie6.2
\[\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 < -8.618354790122042e+153

    1. Initial program 54.0

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Taylor expanded around -inf 1.1

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

      \[\leadsto \color{blue}{-x \cdot y}\]

    if -8.618354790122042e+153 < z < 6.926066888201142e+147

    1. Initial program 11.2

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

      \[\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.2

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

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

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

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

    if 6.926066888201142e+147 < z

    1. Initial program 51.6

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

      \[\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-prod51.6

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

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

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

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

      \[\leadsto y \cdot \left(x \cdot \frac{z}{\color{blue}{\left(\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}\right) \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}}\right)\]
    11. Applied add-cube-cbrt51.0

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

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

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

      \[\leadsto \color{blue}{x \cdot y}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -8.6183547901220424 \cdot 10^{153}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 6.9260668882011419 \cdot 10^{147}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2020045 +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)))))