Average Error: 25.0 → 6.8
Time: 15.4s
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.314671456108926512082813208950851125606 \cdot 10^{154}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 3.742227003601956059846046304592741853886 \cdot 10^{96}:\\ \;\;\;\;\frac{x \cdot y}{\frac{1}{\frac{z}{\sqrt{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.314671456108926512082813208950851125606 \cdot 10^{154}:\\
\;\;\;\;-x \cdot y\\

\mathbf{elif}\;z \le 3.742227003601956059846046304592741853886 \cdot 10^{96}:\\
\;\;\;\;\frac{x \cdot y}{\frac{1}{\frac{z}{\sqrt{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 r1541963 = x;
        double r1541964 = y;
        double r1541965 = r1541963 * r1541964;
        double r1541966 = z;
        double r1541967 = r1541965 * r1541966;
        double r1541968 = r1541966 * r1541966;
        double r1541969 = t;
        double r1541970 = a;
        double r1541971 = r1541969 * r1541970;
        double r1541972 = r1541968 - r1541971;
        double r1541973 = sqrt(r1541972);
        double r1541974 = r1541967 / r1541973;
        return r1541974;
}

double f(double x, double y, double z, double t, double a) {
        double r1541975 = z;
        double r1541976 = -1.3146714561089265e+154;
        bool r1541977 = r1541975 <= r1541976;
        double r1541978 = x;
        double r1541979 = y;
        double r1541980 = r1541978 * r1541979;
        double r1541981 = -r1541980;
        double r1541982 = 3.742227003601956e+96;
        bool r1541983 = r1541975 <= r1541982;
        double r1541984 = 1.0;
        double r1541985 = r1541975 * r1541975;
        double r1541986 = t;
        double r1541987 = a;
        double r1541988 = r1541986 * r1541987;
        double r1541989 = r1541985 - r1541988;
        double r1541990 = sqrt(r1541989);
        double r1541991 = r1541975 / r1541990;
        double r1541992 = r1541984 / r1541991;
        double r1541993 = r1541980 / r1541992;
        double r1541994 = r1541983 ? r1541993 : r1541980;
        double r1541995 = r1541977 ? r1541981 : r1541994;
        return r1541995;
}

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

Original25.0
Target8.2
Herbie6.8
\[\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.3146714561089265e+154

    1. Initial program 54.6

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

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

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

    if -1.3146714561089265e+154 < z < 3.742227003601956e+96

    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 associate-/l*9.6

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

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

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{\sqrt{1} \cdot \sqrt{z \cdot z - t \cdot a}}}{z}}\]
    7. Applied associate-/l*9.6

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

    if 3.742227003601956e+96 < z

    1. Initial program 43.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.314671456108926512082813208950851125606 \cdot 10^{154}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 3.742227003601956059846046304592741853886 \cdot 10^{96}:\\ \;\;\;\;\frac{x \cdot y}{\frac{1}{\frac{z}{\sqrt{z \cdot z - t \cdot a}}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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