Average Error: 24.6 → 6.8
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 -2.908907423900699709629920238106677680786 \cdot 10^{153}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 7.526056547081696508068725299857229016339 \cdot 10^{111}:\\ \;\;\;\;\frac{x}{\sqrt{1}} \cdot \frac{y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\sqrt{1}} \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 -2.908907423900699709629920238106677680786 \cdot 10^{153}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x}{\sqrt{1}} \cdot y\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r224094 = x;
        double r224095 = y;
        double r224096 = r224094 * r224095;
        double r224097 = z;
        double r224098 = r224096 * r224097;
        double r224099 = r224097 * r224097;
        double r224100 = t;
        double r224101 = a;
        double r224102 = r224100 * r224101;
        double r224103 = r224099 - r224102;
        double r224104 = sqrt(r224103);
        double r224105 = r224098 / r224104;
        return r224105;
}

double f(double x, double y, double z, double t, double a) {
        double r224106 = z;
        double r224107 = -2.9089074239006997e+153;
        bool r224108 = r224106 <= r224107;
        double r224109 = -1.0;
        double r224110 = x;
        double r224111 = y;
        double r224112 = r224110 * r224111;
        double r224113 = r224109 * r224112;
        double r224114 = 7.526056547081697e+111;
        bool r224115 = r224106 <= r224114;
        double r224116 = 1.0;
        double r224117 = sqrt(r224116);
        double r224118 = r224110 / r224117;
        double r224119 = r224106 * r224106;
        double r224120 = t;
        double r224121 = a;
        double r224122 = r224120 * r224121;
        double r224123 = r224119 - r224122;
        double r224124 = sqrt(r224123);
        double r224125 = r224124 / r224106;
        double r224126 = r224111 / r224125;
        double r224127 = r224118 * r224126;
        double r224128 = r224118 * r224111;
        double r224129 = r224115 ? r224127 : r224128;
        double r224130 = r224108 ? r224113 : r224129;
        return r224130;
}

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
Target8.3
Herbie6.8
\[\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 < -2.9089074239006997e+153

    1. Initial program 52.7

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied clear-num52.3

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

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

    if -2.9089074239006997e+153 < z < 7.526056547081697e+111

    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 associate-/l*9.6

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

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

      \[\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-prod9.6

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

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

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

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

    if 7.526056547081697e+111 < z

    1. Initial program 45.6

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

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

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

      \[\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-prod43.6

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

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

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

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

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

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

Reproduce

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