Average Error: 25.0 → 6.3
Time: 4.7s
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.325061842645189516831394970526279941677 \cdot 10^{154}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 8.769862591561264993872971347546063427107 \cdot 10^{136}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 1\\ \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.325061842645189516831394970526279941677 \cdot 10^{154}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

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

\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 1\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r248149 = x;
        double r248150 = y;
        double r248151 = r248149 * r248150;
        double r248152 = z;
        double r248153 = r248151 * r248152;
        double r248154 = r248152 * r248152;
        double r248155 = t;
        double r248156 = a;
        double r248157 = r248155 * r248156;
        double r248158 = r248154 - r248157;
        double r248159 = sqrt(r248158);
        double r248160 = r248153 / r248159;
        return r248160;
}

double f(double x, double y, double z, double t, double a) {
        double r248161 = z;
        double r248162 = -1.3250618426451895e+154;
        bool r248163 = r248161 <= r248162;
        double r248164 = -1.0;
        double r248165 = x;
        double r248166 = y;
        double r248167 = r248165 * r248166;
        double r248168 = r248164 * r248167;
        double r248169 = 8.769862591561265e+136;
        bool r248170 = r248161 <= r248169;
        double r248171 = 1.0;
        double r248172 = r248161 * r248161;
        double r248173 = t;
        double r248174 = a;
        double r248175 = r248173 * r248174;
        double r248176 = r248172 - r248175;
        double r248177 = sqrt(r248176);
        double r248178 = r248177 / r248161;
        double r248179 = r248171 / r248178;
        double r248180 = r248167 * r248179;
        double r248181 = r248167 * r248171;
        double r248182 = r248170 ? r248180 : r248181;
        double r248183 = r248163 ? r248168 : r248182;
        return r248183;
}

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
Target7.7
Herbie6.3
\[\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.3250618426451895e+154

    1. Initial program 54.4

      \[\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}{-1 \cdot \left(x \cdot y\right)}\]

    if -1.3250618426451895e+154 < z < 8.769862591561265e+136

    1. Initial program 11.2

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

      \[\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.2

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

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

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

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

    if 8.769862591561265e+136 < z

    1. Initial program 49.8

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

      \[\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-prod49.8

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Taylor expanded around inf 1.7

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{1}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.3

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

Reproduce

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