Average Error: 24.8 → 7.3
Time: 4.6s
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}:\\ \;\;\;\;x \cdot \left(-1 \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}:\\ \;\;\;\;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 -6.7050069327788126 \cdot 10^{76}:\\
\;\;\;\;x \cdot \left(-1 \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}:\\
\;\;\;\;x \cdot y\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r327566 = x;
        double r327567 = y;
        double r327568 = r327566 * r327567;
        double r327569 = z;
        double r327570 = r327568 * r327569;
        double r327571 = r327569 * r327569;
        double r327572 = t;
        double r327573 = a;
        double r327574 = r327572 * r327573;
        double r327575 = r327571 - r327574;
        double r327576 = sqrt(r327575);
        double r327577 = r327570 / r327576;
        return r327577;
}

double f(double x, double y, double z, double t, double a) {
        double r327578 = z;
        double r327579 = -6.705006932778813e+76;
        bool r327580 = r327578 <= r327579;
        double r327581 = x;
        double r327582 = -1.0;
        double r327583 = y;
        double r327584 = r327582 * r327583;
        double r327585 = r327581 * r327584;
        double r327586 = 6.27117431119542e+136;
        bool r327587 = r327578 <= r327586;
        double r327588 = r327583 * r327578;
        double r327589 = 1.0;
        double r327590 = r327578 * r327578;
        double r327591 = t;
        double r327592 = a;
        double r327593 = r327591 * r327592;
        double r327594 = r327590 - r327593;
        double r327595 = sqrt(r327594);
        double r327596 = r327589 / r327595;
        double r327597 = r327588 * r327596;
        double r327598 = r327581 * r327597;
        double r327599 = r327581 * r327583;
        double r327600 = r327587 ? r327598 : r327599;
        double r327601 = r327580 ? r327585 : r327600;
        return r327601;
}

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. Taylor expanded around -inf 2.9

      \[\leadsto x \cdot \color{blue}{\left(-1 \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. Taylor expanded around inf 1.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -6.7050069327788126 \cdot 10^{76}:\\ \;\;\;\;x \cdot \left(-1 \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}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2020062 
(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)))))