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}:\\ \;\;\;\;x \cdot \frac{y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\ \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}:\\
\;\;\;\;x \cdot \frac{y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r403102 = x;
        double r403103 = y;
        double r403104 = r403102 * r403103;
        double r403105 = z;
        double r403106 = r403104 * r403105;
        double r403107 = r403105 * r403105;
        double r403108 = t;
        double r403109 = a;
        double r403110 = r403108 * r403109;
        double r403111 = r403107 - r403110;
        double r403112 = sqrt(r403111);
        double r403113 = r403106 / r403112;
        return r403113;
}

double f(double x, double y, double z, double t, double a) {
        double r403114 = z;
        double r403115 = -8.618354790122042e+153;
        bool r403116 = r403114 <= r403115;
        double r403117 = x;
        double r403118 = y;
        double r403119 = r403117 * r403118;
        double r403120 = -r403119;
        double r403121 = 6.926066888201142e+147;
        bool r403122 = r403114 <= r403121;
        double r403123 = r403114 * r403114;
        double r403124 = t;
        double r403125 = a;
        double r403126 = r403124 * r403125;
        double r403127 = r403123 - r403126;
        double r403128 = sqrt(r403127);
        double r403129 = r403128 / r403114;
        double r403130 = r403118 / r403129;
        double r403131 = r403117 * r403130;
        double r403132 = r403122 ? r403131 : r403119;
        double r403133 = r403116 ? r403120 : r403132;
        return r403133;
}

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity8.9

      \[\leadsto \frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{\color{blue}{1 \cdot z}}}\]
    6. Applied *-un-lft-identity8.9

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

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

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

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

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

    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. 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}:\\ \;\;\;\;x \cdot \frac{y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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