Average Error: 24.9 → 7.7
Time: 22.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.885407554804660517455724314669671165557 \cdot 10^{71}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \le 5.930939844067445722258493130712277239397 \cdot 10^{90}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot z\right)}{\sqrt{z \cdot z - a \cdot t}}\\ \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 -2.885407554804660517455724314669671165557 \cdot 10^{71}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r14817633 = x;
        double r14817634 = y;
        double r14817635 = r14817633 * r14817634;
        double r14817636 = z;
        double r14817637 = r14817635 * r14817636;
        double r14817638 = r14817636 * r14817636;
        double r14817639 = t;
        double r14817640 = a;
        double r14817641 = r14817639 * r14817640;
        double r14817642 = r14817638 - r14817641;
        double r14817643 = sqrt(r14817642);
        double r14817644 = r14817637 / r14817643;
        return r14817644;
}

double f(double x, double y, double z, double t, double a) {
        double r14817645 = z;
        double r14817646 = -2.8854075548046605e+71;
        bool r14817647 = r14817645 <= r14817646;
        double r14817648 = y;
        double r14817649 = x;
        double r14817650 = -r14817649;
        double r14817651 = r14817648 * r14817650;
        double r14817652 = 5.930939844067446e+90;
        bool r14817653 = r14817645 <= r14817652;
        double r14817654 = r14817648 * r14817645;
        double r14817655 = r14817649 * r14817654;
        double r14817656 = r14817645 * r14817645;
        double r14817657 = a;
        double r14817658 = t;
        double r14817659 = r14817657 * r14817658;
        double r14817660 = r14817656 - r14817659;
        double r14817661 = sqrt(r14817660);
        double r14817662 = r14817655 / r14817661;
        double r14817663 = r14817648 * r14817649;
        double r14817664 = r14817653 ? r14817662 : r14817663;
        double r14817665 = r14817647 ? r14817651 : r14817664;
        return r14817665;
}

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.9
Target7.9
Herbie7.7
\[\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.8854075548046605e+71

    1. Initial program 39.6

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied associate-/l*36.6

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

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

      \[\leadsto \color{blue}{-y \cdot x}\]

    if -2.8854075548046605e+71 < z < 5.930939844067446e+90

    1. Initial program 11.0

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

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

    if 5.930939844067446e+90 < z

    1. Initial program 43.0

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

      \[\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 -2.885407554804660517455724314669671165557 \cdot 10^{71}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \le 5.930939844067445722258493130712277239397 \cdot 10^{90}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot z\right)}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]

Reproduce

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