Average Error: 24.8 → 7.6
Time: 16.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 -2.106976415350951692258705282827720142037 \cdot 10^{65}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 0.007263648305243833834532463100686072721146:\\ \;\;\;\;\frac{x \cdot 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 -2.106976415350951692258705282827720142037 \cdot 10^{65}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \le 0.007263648305243833834532463100686072721146:\\
\;\;\;\;\frac{x \cdot 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 r14178566 = x;
        double r14178567 = y;
        double r14178568 = r14178566 * r14178567;
        double r14178569 = z;
        double r14178570 = r14178568 * r14178569;
        double r14178571 = r14178569 * r14178569;
        double r14178572 = t;
        double r14178573 = a;
        double r14178574 = r14178572 * r14178573;
        double r14178575 = r14178571 - r14178574;
        double r14178576 = sqrt(r14178575);
        double r14178577 = r14178570 / r14178576;
        return r14178577;
}

double f(double x, double y, double z, double t, double a) {
        double r14178578 = z;
        double r14178579 = -2.1069764153509517e+65;
        bool r14178580 = r14178578 <= r14178579;
        double r14178581 = x;
        double r14178582 = y;
        double r14178583 = -r14178582;
        double r14178584 = r14178581 * r14178583;
        double r14178585 = 0.007263648305243834;
        bool r14178586 = r14178578 <= r14178585;
        double r14178587 = r14178581 * r14178582;
        double r14178588 = r14178578 * r14178578;
        double r14178589 = t;
        double r14178590 = a;
        double r14178591 = r14178589 * r14178590;
        double r14178592 = r14178588 - r14178591;
        double r14178593 = sqrt(r14178592);
        double r14178594 = r14178593 / r14178578;
        double r14178595 = r14178587 / r14178594;
        double r14178596 = r14178586 ? r14178595 : r14178587;
        double r14178597 = r14178580 ? r14178584 : r14178596;
        return r14178597;
}

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.8
Target7.5
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 < -2.1069764153509517e+65

    1. Initial program 39.3

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

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

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

    if -2.1069764153509517e+65 < z < 0.007263648305243834

    1. Initial program 11.6

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

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

    if 0.007263648305243834 < z

    1. Initial program 32.4

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

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

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

Reproduce

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