Average Error: 23.8 → 5.9
Time: 15.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.8913959868564195 \cdot 10^{+154}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \le 1.1848486164183457 \cdot 10^{+114}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \left(z \cdot \frac{1}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \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.8913959868564195 \cdot 10^{+154}:\\
\;\;\;\;-y \cdot x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r16941453 = x;
        double r16941454 = y;
        double r16941455 = r16941453 * r16941454;
        double r16941456 = z;
        double r16941457 = r16941455 * r16941456;
        double r16941458 = r16941456 * r16941456;
        double r16941459 = t;
        double r16941460 = a;
        double r16941461 = r16941459 * r16941460;
        double r16941462 = r16941458 - r16941461;
        double r16941463 = sqrt(r16941462);
        double r16941464 = r16941457 / r16941463;
        return r16941464;
}

double f(double x, double y, double z, double t, double a) {
        double r16941465 = z;
        double r16941466 = -1.8913959868564195e+154;
        bool r16941467 = r16941465 <= r16941466;
        double r16941468 = y;
        double r16941469 = x;
        double r16941470 = r16941468 * r16941469;
        double r16941471 = -r16941470;
        double r16941472 = 1.1848486164183457e+114;
        bool r16941473 = r16941465 <= r16941472;
        double r16941474 = 1.0;
        double r16941475 = r16941465 * r16941465;
        double r16941476 = a;
        double r16941477 = t;
        double r16941478 = r16941476 * r16941477;
        double r16941479 = r16941475 - r16941478;
        double r16941480 = sqrt(r16941479);
        double r16941481 = r16941474 / r16941480;
        double r16941482 = r16941465 * r16941481;
        double r16941483 = r16941470 * r16941482;
        double r16941484 = r16941473 ? r16941483 : r16941470;
        double r16941485 = r16941467 ? r16941471 : r16941484;
        return r16941485;
}

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

Original23.8
Target7.6
Herbie5.9
\[\begin{array}{l} \mathbf{if}\;z \lt -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.976268120920894 \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.8913959868564195e+154

    1. Initial program 53.3

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

      \[\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-prod53.3

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

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

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

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

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

    if -1.8913959868564195e+154 < z < 1.1848486164183457e+114

    1. Initial program 10.2

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

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

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

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

    if 1.1848486164183457e+114 < z

    1. Initial program 45.5

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

      \[\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-prod45.5

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

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

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

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

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

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

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

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

Reproduce

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