Average Error: 24.6 → 7.9
Time: 17.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 -3.603369414995160960353922152048984349949 \cdot 10^{90}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 1.292716185531284079912157099666096901234 \cdot 10^{-12}:\\ \;\;\;\;\frac{\left(y \cdot z\right) \cdot x}{\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 -3.603369414995160960353922152048984349949 \cdot 10^{90}:\\
\;\;\;\;-x \cdot y\\

\mathbf{elif}\;z \le 1.292716185531284079912157099666096901234 \cdot 10^{-12}:\\
\;\;\;\;\frac{\left(y \cdot z\right) \cdot x}{\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 r207614 = x;
        double r207615 = y;
        double r207616 = r207614 * r207615;
        double r207617 = z;
        double r207618 = r207616 * r207617;
        double r207619 = r207617 * r207617;
        double r207620 = t;
        double r207621 = a;
        double r207622 = r207620 * r207621;
        double r207623 = r207619 - r207622;
        double r207624 = sqrt(r207623);
        double r207625 = r207618 / r207624;
        return r207625;
}

double f(double x, double y, double z, double t, double a) {
        double r207626 = z;
        double r207627 = -3.603369414995161e+90;
        bool r207628 = r207626 <= r207627;
        double r207629 = x;
        double r207630 = y;
        double r207631 = r207629 * r207630;
        double r207632 = -r207631;
        double r207633 = 1.292716185531284e-12;
        bool r207634 = r207626 <= r207633;
        double r207635 = r207630 * r207626;
        double r207636 = r207635 * r207629;
        double r207637 = r207626 * r207626;
        double r207638 = t;
        double r207639 = a;
        double r207640 = r207638 * r207639;
        double r207641 = r207637 - r207640;
        double r207642 = sqrt(r207641);
        double r207643 = r207636 / r207642;
        double r207644 = r207634 ? r207643 : r207631;
        double r207645 = r207628 ? r207632 : r207644;
        return r207645;
}

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.6
Target7.3
Herbie7.9
\[\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 < -3.603369414995161e+90

    1. Initial program 42.5

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

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

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

    if -3.603369414995161e+90 < z < 1.292716185531284e-12

    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 pow111.4

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

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

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

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

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

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

    if 1.292716185531284e-12 < z

    1. Initial program 31.8

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

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

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

Reproduce

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