Average Error: 23.9 → 7.7
Time: 16.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 -1.0884743696281288 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \le 1.1088800579390318 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(y \cdot z\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.0884743696281288 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r14578173 = x;
        double r14578174 = y;
        double r14578175 = r14578173 * r14578174;
        double r14578176 = z;
        double r14578177 = r14578175 * r14578176;
        double r14578178 = r14578176 * r14578176;
        double r14578179 = t;
        double r14578180 = a;
        double r14578181 = r14578179 * r14578180;
        double r14578182 = r14578178 - r14578181;
        double r14578183 = sqrt(r14578182);
        double r14578184 = r14578177 / r14578183;
        return r14578184;
}

double f(double x, double y, double z, double t, double a) {
        double r14578185 = z;
        double r14578186 = -1.0884743696281288e+48;
        bool r14578187 = r14578185 <= r14578186;
        double r14578188 = y;
        double r14578189 = x;
        double r14578190 = -r14578189;
        double r14578191 = r14578188 * r14578190;
        double r14578192 = 1.1088800579390318e+41;
        bool r14578193 = r14578185 <= r14578192;
        double r14578194 = r14578185 * r14578185;
        double r14578195 = t;
        double r14578196 = a;
        double r14578197 = r14578195 * r14578196;
        double r14578198 = r14578194 - r14578197;
        double r14578199 = sqrt(r14578198);
        double r14578200 = r14578189 / r14578199;
        double r14578201 = r14578188 * r14578185;
        double r14578202 = r14578200 * r14578201;
        double r14578203 = r14578188 * r14578189;
        double r14578204 = r14578193 ? r14578202 : r14578203;
        double r14578205 = r14578187 ? r14578191 : r14578204;
        return r14578205;
}

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.9
Target7.5
Herbie7.7
\[\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.0884743696281288e+48

    1. Initial program 35.5

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified33.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 associate-*l*33.3

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

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

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

    if -1.0884743696281288e+48 < z < 1.1088800579390318e+41

    1. Initial program 11.4

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*10.3

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied div-inv10.3

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

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

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

    if 1.1088800579390318e+41 < z

    1. Initial program 35.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.0884743696281288 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \le 1.1088800579390318 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{\sqrt{z \cdot z - t \cdot a}} \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]

Reproduce

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