Average Error: 23.9 → 7.7
Time: 17.3s
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}:\\ \;\;\;\;\left(-x\right) \cdot y\\ \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}:\\ \;\;\;\;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 -1.0884743696281288 \cdot 10^{+48}:\\
\;\;\;\;\left(-x\right) \cdot y\\

\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}:\\
\;\;\;\;x \cdot y\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r11626102 = x;
        double r11626103 = y;
        double r11626104 = r11626102 * r11626103;
        double r11626105 = z;
        double r11626106 = r11626104 * r11626105;
        double r11626107 = r11626105 * r11626105;
        double r11626108 = t;
        double r11626109 = a;
        double r11626110 = r11626108 * r11626109;
        double r11626111 = r11626107 - r11626110;
        double r11626112 = sqrt(r11626111);
        double r11626113 = r11626106 / r11626112;
        return r11626113;
}

double f(double x, double y, double z, double t, double a) {
        double r11626114 = z;
        double r11626115 = -1.0884743696281288e+48;
        bool r11626116 = r11626114 <= r11626115;
        double r11626117 = x;
        double r11626118 = -r11626117;
        double r11626119 = y;
        double r11626120 = r11626118 * r11626119;
        double r11626121 = 1.1088800579390318e+41;
        bool r11626122 = r11626114 <= r11626121;
        double r11626123 = r11626114 * r11626114;
        double r11626124 = t;
        double r11626125 = a;
        double r11626126 = r11626124 * r11626125;
        double r11626127 = r11626123 - r11626126;
        double r11626128 = sqrt(r11626127);
        double r11626129 = r11626117 / r11626128;
        double r11626130 = r11626119 * r11626114;
        double r11626131 = r11626129 * r11626130;
        double r11626132 = r11626117 * r11626119;
        double r11626133 = r11626122 ? r11626131 : r11626132;
        double r11626134 = r11626116 ? r11626120 : r11626133;
        return r11626134;
}

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 associate-/l*33.2

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Taylor expanded around -inf 3.4

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

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

    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}:\\ \;\;\;\;\left(-x\right) \cdot y\\ \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}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019158 +o rules:numerics
(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)))))