Average Error: 23.8 → 5.9
Time: 14.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 -1.8913959868564195 \cdot 10^{+154}:\\ \;\;\;\;\left(-y\right) \cdot x\\ \mathbf{elif}\;z \le 1.1848486164183457 \cdot 10^{+114}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \left(z \cdot \frac{1}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \le -1.8913959868564195 \cdot 10^{+154}:\\
\;\;\;\;\left(-y\right) \cdot x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r18267600 = x;
        double r18267601 = y;
        double r18267602 = r18267600 * r18267601;
        double r18267603 = z;
        double r18267604 = r18267602 * r18267603;
        double r18267605 = r18267603 * r18267603;
        double r18267606 = t;
        double r18267607 = a;
        double r18267608 = r18267606 * r18267607;
        double r18267609 = r18267605 - r18267608;
        double r18267610 = sqrt(r18267609);
        double r18267611 = r18267604 / r18267610;
        return r18267611;
}

double f(double x, double y, double z, double t, double a) {
        double r18267612 = z;
        double r18267613 = -1.8913959868564195e+154;
        bool r18267614 = r18267612 <= r18267613;
        double r18267615 = y;
        double r18267616 = -r18267615;
        double r18267617 = x;
        double r18267618 = r18267616 * r18267617;
        double r18267619 = 1.1848486164183457e+114;
        bool r18267620 = r18267612 <= r18267619;
        double r18267621 = r18267615 * r18267617;
        double r18267622 = 1.0;
        double r18267623 = r18267612 * r18267612;
        double r18267624 = a;
        double r18267625 = t;
        double r18267626 = r18267624 * r18267625;
        double r18267627 = r18267623 - r18267626;
        double r18267628 = sqrt(r18267627);
        double r18267629 = r18267622 / r18267628;
        double r18267630 = r18267612 * r18267629;
        double r18267631 = r18267621 * r18267630;
        double r18267632 = r18267620 ? r18267631 : r18267621;
        double r18267633 = r18267614 ? r18267618 : r18267632;
        return r18267633;
}

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

Original23.8
Target7.6
Herbie5.9
\[\begin{array}{l} \mathbf{if}\;z \lt -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.976268120920894 \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 < -1.8913959868564195e+154

    1. Initial program 53.3

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

      \[\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-prod53.3

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

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

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

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

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

    if -1.8913959868564195e+154 < z < 1.1848486164183457e+114

    1. Initial program 10.2

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity10.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-prod10.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.2

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

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

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

    if 1.1848486164183457e+114 < z

    1. Initial program 45.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.8913959868564195 \cdot 10^{+154}:\\ \;\;\;\;\left(-y\right) \cdot x\\ \mathbf{elif}\;z \le 1.1848486164183457 \cdot 10^{+114}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \left(z \cdot \frac{1}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]

Reproduce

herbie shell --seed 2019163 
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"

  :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)))))