Average Error: 24.5 → 5.4
Time: 17.4s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -6.506706062111452568496513260808126439647 \cdot 10^{153}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 3.243528684537981667725101402901133521761 \cdot 10^{132}:\\ \;\;\;\;\frac{x}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{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 -6.506706062111452568496513260808126439647 \cdot 10^{153}:\\
\;\;\;\;-x \cdot y\\

\mathbf{elif}\;z \le 3.243528684537981667725101402901133521761 \cdot 10^{132}:\\
\;\;\;\;\frac{x}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r139292 = x;
        double r139293 = y;
        double r139294 = r139292 * r139293;
        double r139295 = z;
        double r139296 = r139294 * r139295;
        double r139297 = r139295 * r139295;
        double r139298 = t;
        double r139299 = a;
        double r139300 = r139298 * r139299;
        double r139301 = r139297 - r139300;
        double r139302 = sqrt(r139301);
        double r139303 = r139296 / r139302;
        return r139303;
}

double f(double x, double y, double z, double t, double a) {
        double r139304 = z;
        double r139305 = -6.5067060621114526e+153;
        bool r139306 = r139304 <= r139305;
        double r139307 = x;
        double r139308 = y;
        double r139309 = r139307 * r139308;
        double r139310 = -r139309;
        double r139311 = 3.2435286845379817e+132;
        bool r139312 = r139304 <= r139311;
        double r139313 = r139304 * r139304;
        double r139314 = t;
        double r139315 = a;
        double r139316 = r139314 * r139315;
        double r139317 = r139313 - r139316;
        double r139318 = sqrt(r139317);
        double r139319 = cbrt(r139318);
        double r139320 = r139319 * r139319;
        double r139321 = cbrt(r139304);
        double r139322 = r139321 * r139321;
        double r139323 = r139320 / r139322;
        double r139324 = r139307 / r139323;
        double r139325 = r139319 / r139321;
        double r139326 = r139308 / r139325;
        double r139327 = r139324 * r139326;
        double r139328 = r139312 ? r139327 : r139309;
        double r139329 = r139306 ? r139310 : r139328;
        return r139329;
}

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.5
Target7.8
Herbie5.4
\[\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 < -6.5067060621114526e+153

    1. Initial program 53.4

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

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

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

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

    if -6.5067060621114526e+153 < z < 3.2435286845379817e+132

    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.2

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt9.9

      \[\leadsto \frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}}\]
    6. Applied add-cube-cbrt9.4

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

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

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

    if 3.2435286845379817e+132 < z

    1. Initial program 48.8

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -6.506706062111452568496513260808126439647 \cdot 10^{153}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 3.243528684537981667725101402901133521761 \cdot 10^{132}:\\ \;\;\;\;\frac{x}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019326 +o rules:numerics
(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.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)))))