Average Error: 24.9 → 6.0
Time: 8.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.63912937841539549499323805785233795264 \cdot 10^{153}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 1.972031711751160647332172966105322255619 \cdot 10^{149}:\\ \;\;\;\;\frac{x}{\sqrt{1}} \cdot \frac{y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\ \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.63912937841539549499323805785233795264 \cdot 10^{153}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 1.972031711751160647332172966105322255619 \cdot 10^{149}:\\
\;\;\;\;\frac{x}{\sqrt{1}} \cdot \frac{y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r205436 = x;
        double r205437 = y;
        double r205438 = r205436 * r205437;
        double r205439 = z;
        double r205440 = r205438 * r205439;
        double r205441 = r205439 * r205439;
        double r205442 = t;
        double r205443 = a;
        double r205444 = r205442 * r205443;
        double r205445 = r205441 - r205444;
        double r205446 = sqrt(r205445);
        double r205447 = r205440 / r205446;
        return r205447;
}

double f(double x, double y, double z, double t, double a) {
        double r205448 = z;
        double r205449 = -1.6391293784153955e+153;
        bool r205450 = r205448 <= r205449;
        double r205451 = -1.0;
        double r205452 = x;
        double r205453 = y;
        double r205454 = r205452 * r205453;
        double r205455 = r205451 * r205454;
        double r205456 = 1.9720317117511606e+149;
        bool r205457 = r205448 <= r205456;
        double r205458 = 1.0;
        double r205459 = sqrt(r205458);
        double r205460 = r205452 / r205459;
        double r205461 = r205448 * r205448;
        double r205462 = t;
        double r205463 = a;
        double r205464 = r205462 * r205463;
        double r205465 = r205461 - r205464;
        double r205466 = sqrt(r205465);
        double r205467 = r205466 / r205448;
        double r205468 = r205453 / r205467;
        double r205469 = r205460 * r205468;
        double r205470 = r205457 ? r205469 : r205454;
        double r205471 = r205450 ? r205455 : r205470;
        return r205471;
}

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.9
Target7.5
Herbie6.0
\[\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.6391293784153955e+153

    1. Initial program 53.6

      \[\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.6391293784153955e+153 < z < 1.9720317117511606e+149

    1. Initial program 10.9

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity8.9

      \[\leadsto \frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{\color{blue}{1 \cdot z}}}\]
    6. Applied *-un-lft-identity8.9

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

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{\sqrt{1} \cdot \sqrt{z \cdot z - t \cdot a}}}{1 \cdot z}}\]
    8. Applied times-frac8.9

      \[\leadsto \frac{x \cdot y}{\color{blue}{\frac{\sqrt{1}}{1} \cdot \frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    9. Applied times-frac8.3

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

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

    if 1.9720317117511606e+149 < z

    1. Initial program 53.6

      \[\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}{x \cdot y}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.0

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

Reproduce

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