Average Error: 24.7 → 6.3
Time: 22.8s
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.034236276819987094281376862709570586245 \cdot 10^{154}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 1.884191544785360628407970936723469922143 \cdot 10^{77}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \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.034236276819987094281376862709570586245 \cdot 10^{154}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r57235267 = x;
        double r57235268 = y;
        double r57235269 = r57235267 * r57235268;
        double r57235270 = z;
        double r57235271 = r57235269 * r57235270;
        double r57235272 = r57235270 * r57235270;
        double r57235273 = t;
        double r57235274 = a;
        double r57235275 = r57235273 * r57235274;
        double r57235276 = r57235272 - r57235275;
        double r57235277 = sqrt(r57235276);
        double r57235278 = r57235271 / r57235277;
        return r57235278;
}

double f(double x, double y, double z, double t, double a) {
        double r57235279 = z;
        double r57235280 = -1.0342362768199871e+154;
        bool r57235281 = r57235279 <= r57235280;
        double r57235282 = x;
        double r57235283 = y;
        double r57235284 = -r57235283;
        double r57235285 = r57235282 * r57235284;
        double r57235286 = 1.8841915447853606e+77;
        bool r57235287 = r57235279 <= r57235286;
        double r57235288 = r57235279 * r57235279;
        double r57235289 = t;
        double r57235290 = a;
        double r57235291 = r57235289 * r57235290;
        double r57235292 = r57235288 - r57235291;
        double r57235293 = sqrt(r57235292);
        double r57235294 = r57235279 / r57235293;
        double r57235295 = r57235283 * r57235294;
        double r57235296 = r57235282 * r57235295;
        double r57235297 = r57235282 * r57235283;
        double r57235298 = r57235287 ? r57235296 : r57235297;
        double r57235299 = r57235281 ? r57235285 : r57235298;
        return r57235299;
}

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.7
Target7.5
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.0342362768199871e+154

    1. Initial program 54.4

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity54.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-prod54.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-frac54.1

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

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

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

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

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

    if -1.0342362768199871e+154 < z < 1.8841915447853606e+77

    1. Initial program 11.0

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

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

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

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

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

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

    if 1.8841915447853606e+77 < z

    1. Initial program 41.3

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

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

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

Reproduce

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