Average Error: 24.5 → 7.6
Time: 16.9s
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.105222870019657843764947192797768671913 \cdot 10^{88}:\\ \;\;\;\;\left(-x\right) \cdot y\\ \mathbf{elif}\;z \le 2.035196962814329099118871956199536142841 \cdot 10^{61}:\\ \;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{\sqrt{z \cdot z - a \cdot t}}\\ \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.105222870019657843764947192797768671913 \cdot 10^{88}:\\
\;\;\;\;\left(-x\right) \cdot y\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r240035 = x;
        double r240036 = y;
        double r240037 = r240035 * r240036;
        double r240038 = z;
        double r240039 = r240037 * r240038;
        double r240040 = r240038 * r240038;
        double r240041 = t;
        double r240042 = a;
        double r240043 = r240041 * r240042;
        double r240044 = r240040 - r240043;
        double r240045 = sqrt(r240044);
        double r240046 = r240039 / r240045;
        return r240046;
}

double f(double x, double y, double z, double t, double a) {
        double r240047 = z;
        double r240048 = -1.1052228700196578e+88;
        bool r240049 = r240047 <= r240048;
        double r240050 = x;
        double r240051 = -r240050;
        double r240052 = y;
        double r240053 = r240051 * r240052;
        double r240054 = 2.035196962814329e+61;
        bool r240055 = r240047 <= r240054;
        double r240056 = r240047 * r240052;
        double r240057 = r240050 * r240056;
        double r240058 = r240047 * r240047;
        double r240059 = a;
        double r240060 = t;
        double r240061 = r240059 * r240060;
        double r240062 = r240058 - r240061;
        double r240063 = sqrt(r240062);
        double r240064 = r240057 / r240063;
        double r240065 = r240050 * r240052;
        double r240066 = r240055 ? r240064 : r240065;
        double r240067 = r240049 ? r240053 : r240066;
        return r240067;
}

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.5
Target7.6
Herbie7.6
\[\begin{array}{l} \mathbf{if}\;z \lt -3.192130590385276419686361646843883646209 \cdot 10^{46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.976268120920894210257945708950453212935 \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.1052228700196578e+88

    1. Initial program 41.3

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Simplified41.8

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

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

      \[\leadsto \color{blue}{\left(\frac{x}{1} \cdot \frac{y}{\sqrt{z \cdot z - a \cdot t}}\right)} \cdot z\]
    6. Applied associate-*l*41.2

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

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

      \[\leadsto \frac{x}{1} \cdot \color{blue}{\left(-1 \cdot y\right)}\]
    9. Simplified2.9

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

    if -1.1052228700196578e+88 < z < 2.035196962814329e+61

    1. Initial program 10.8

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Simplified11.0

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

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

      \[\leadsto \color{blue}{\left(\frac{x}{1} \cdot \frac{y}{\sqrt{z \cdot z - a \cdot t}}\right)} \cdot z\]
    6. Applied associate-*l*11.1

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

      \[\leadsto \frac{x}{1} \cdot \color{blue}{\frac{y \cdot z}{\sqrt{z \cdot z - a \cdot t}}}\]
    8. Using strategy rm
    9. Applied add-sqr-sqrt10.8

      \[\leadsto \frac{x}{\color{blue}{\sqrt{1} \cdot \sqrt{1}}} \cdot \frac{y \cdot z}{\sqrt{z \cdot z - a \cdot t}}\]
    10. Applied *-un-lft-identity10.8

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

      \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{1}} \cdot \frac{x}{\sqrt{1}}\right)} \cdot \frac{y \cdot z}{\sqrt{z \cdot z - a \cdot t}}\]
    12. Applied associate-*l*10.8

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

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

    if 2.035196962814329e+61 < z

    1. Initial program 39.1

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Simplified38.0

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

      \[\leadsto \color{blue}{x \cdot y}\]
    4. Simplified3.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.105222870019657843764947192797768671913 \cdot 10^{88}:\\ \;\;\;\;\left(-x\right) \cdot y\\ \mathbf{elif}\;z \le 2.035196962814329099118871956199536142841 \cdot 10^{61}:\\ \;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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