Average Error: 24.9 → 6.2
Time: 17.2s
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.088803820769309971203230753638447899806 \cdot 10^{119}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 1.426839275983628882434299682202683477788 \cdot 10^{149}:\\ \;\;\;\;\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}\\ \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.088803820769309971203230753638447899806 \cdot 10^{119}:\\
\;\;\;\;-x \cdot y\\

\mathbf{elif}\;z \le 1.426839275983628882434299682202683477788 \cdot 10^{149}:\\
\;\;\;\;\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r269589 = x;
        double r269590 = y;
        double r269591 = r269589 * r269590;
        double r269592 = z;
        double r269593 = r269591 * r269592;
        double r269594 = r269592 * r269592;
        double r269595 = t;
        double r269596 = a;
        double r269597 = r269595 * r269596;
        double r269598 = r269594 - r269597;
        double r269599 = sqrt(r269598);
        double r269600 = r269593 / r269599;
        return r269600;
}

double f(double x, double y, double z, double t, double a) {
        double r269601 = z;
        double r269602 = -1.08880382076931e+119;
        bool r269603 = r269601 <= r269602;
        double r269604 = x;
        double r269605 = y;
        double r269606 = r269604 * r269605;
        double r269607 = -r269606;
        double r269608 = 1.4268392759836289e+149;
        bool r269609 = r269601 <= r269608;
        double r269610 = r269601 * r269601;
        double r269611 = t;
        double r269612 = a;
        double r269613 = r269611 * r269612;
        double r269614 = r269610 - r269613;
        double r269615 = sqrt(r269614);
        double r269616 = r269615 / r269601;
        double r269617 = r269616 / r269605;
        double r269618 = r269604 / r269617;
        double r269619 = r269609 ? r269618 : r269606;
        double r269620 = r269603 ? r269607 : r269619;
        return r269620;
}

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.5
Herbie6.2
\[\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.08880382076931e+119

    1. Initial program 46.4

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

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

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

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

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

    if -1.08880382076931e+119 < z < 1.4268392759836289e+149

    1. Initial program 10.8

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

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

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

    if 1.4268392759836289e+149 < z

    1. Initial program 53.5

      \[\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}{x \cdot y}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.088803820769309971203230753638447899806 \cdot 10^{119}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 1.426839275983628882434299682202683477788 \cdot 10^{149}:\\ \;\;\;\;\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019304 
(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.1921305903852764e46) (- (* y x)) (if (< z 5.9762681209208942e90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))