Average Error: 24.8 → 7.2
Time: 4.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 -1.1055887578016406 \cdot 10^{87}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 8.0013809758777307 \cdot 10^{126}:\\ \;\;\;\;\frac{\left(x \cdot y\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|} \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\\ \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.1055887578016406 \cdot 10^{87}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 8.0013809758777307 \cdot 10^{126}:\\
\;\;\;\;\frac{\left(x \cdot y\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|} \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r407799 = x;
        double r407800 = y;
        double r407801 = r407799 * r407800;
        double r407802 = z;
        double r407803 = r407801 * r407802;
        double r407804 = r407802 * r407802;
        double r407805 = t;
        double r407806 = a;
        double r407807 = r407805 * r407806;
        double r407808 = r407804 - r407807;
        double r407809 = sqrt(r407808);
        double r407810 = r407803 / r407809;
        return r407810;
}

double f(double x, double y, double z, double t, double a) {
        double r407811 = z;
        double r407812 = -1.1055887578016406e+87;
        bool r407813 = r407811 <= r407812;
        double r407814 = -1.0;
        double r407815 = x;
        double r407816 = y;
        double r407817 = r407815 * r407816;
        double r407818 = r407814 * r407817;
        double r407819 = 8.001380975877731e+126;
        bool r407820 = r407811 <= r407819;
        double r407821 = cbrt(r407811);
        double r407822 = r407821 * r407821;
        double r407823 = r407817 * r407822;
        double r407824 = r407811 * r407811;
        double r407825 = t;
        double r407826 = a;
        double r407827 = r407825 * r407826;
        double r407828 = r407824 - r407827;
        double r407829 = cbrt(r407828);
        double r407830 = fabs(r407829);
        double r407831 = r407823 / r407830;
        double r407832 = sqrt(r407829);
        double r407833 = r407821 / r407832;
        double r407834 = r407831 * r407833;
        double r407835 = r407820 ? r407834 : r407817;
        double r407836 = r407813 ? r407818 : r407835;
        return r407836;
}

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.8
Herbie7.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 < -1.1055887578016406e+87

    1. Initial program 40.6

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

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

    if -1.1055887578016406e+87 < z < 8.001380975877731e+126

    1. Initial program 11.4

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity11.4

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt10.0

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

      \[\leadsto \left(x \cdot y\right) \cdot \frac{z}{\color{blue}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a} \cdot \sqrt[3]{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}}\]
    10. Applied add-cube-cbrt10.3

      \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a} \cdot \sqrt[3]{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    11. Applied times-frac10.3

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

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

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

    if 8.001380975877731e+126 < z

    1. Initial program 47.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.1055887578016406 \cdot 10^{87}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 8.0013809758777307 \cdot 10^{126}:\\ \;\;\;\;\frac{\left(x \cdot y\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|} \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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