Average Error: 24.3 → 6.1
Time: 13.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 -4.403812811655348436228482044852905985381 \cdot 10^{136}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 2.130897152856615796932912078487397342387 \cdot 10^{121}:\\ \;\;\;\;\frac{x \cdot y}{\sqrt{1}} \cdot \left(z \cdot \frac{1}{\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 -4.403812811655348436228482044852905985381 \cdot 10^{136}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 2.130897152856615796932912078487397342387 \cdot 10^{121}:\\
\;\;\;\;\frac{x \cdot y}{\sqrt{1}} \cdot \left(z \cdot \frac{1}{\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 r276701 = x;
        double r276702 = y;
        double r276703 = r276701 * r276702;
        double r276704 = z;
        double r276705 = r276703 * r276704;
        double r276706 = r276704 * r276704;
        double r276707 = t;
        double r276708 = a;
        double r276709 = r276707 * r276708;
        double r276710 = r276706 - r276709;
        double r276711 = sqrt(r276710);
        double r276712 = r276705 / r276711;
        return r276712;
}

double f(double x, double y, double z, double t, double a) {
        double r276713 = z;
        double r276714 = -4.4038128116553484e+136;
        bool r276715 = r276713 <= r276714;
        double r276716 = -1.0;
        double r276717 = x;
        double r276718 = y;
        double r276719 = r276717 * r276718;
        double r276720 = r276716 * r276719;
        double r276721 = 2.130897152856616e+121;
        bool r276722 = r276713 <= r276721;
        double r276723 = 1.0;
        double r276724 = sqrt(r276723);
        double r276725 = r276719 / r276724;
        double r276726 = r276713 * r276713;
        double r276727 = t;
        double r276728 = a;
        double r276729 = r276727 * r276728;
        double r276730 = r276726 - r276729;
        double r276731 = sqrt(r276730);
        double r276732 = r276723 / r276731;
        double r276733 = r276713 * r276732;
        double r276734 = r276725 * r276733;
        double r276735 = r276722 ? r276734 : r276719;
        double r276736 = r276715 ? r276720 : r276735;
        return r276736;
}

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.3
Target7.4
Herbie6.1
\[\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 < -4.4038128116553484e+136

    1. Initial program 51.0

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Using strategy rm
    7. Applied div-inv49.7

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

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

    if -4.4038128116553484e+136 < z < 2.130897152856616e+121

    1. Initial program 10.5

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Using strategy rm
    7. Applied div-inv8.6

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

    if 2.130897152856616e+121 < z

    1. Initial program 46.6

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*44.6

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Taylor expanded around inf 2.0

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

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

Reproduce

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