Average Error: 24.5 → 5.4
Time: 17.5s
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}:\\ \;\;\;\;-y \cdot x\\ \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}:\\
\;\;\;\;-y \cdot x\\

\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 r147632 = x;
        double r147633 = y;
        double r147634 = r147632 * r147633;
        double r147635 = z;
        double r147636 = r147634 * r147635;
        double r147637 = r147635 * r147635;
        double r147638 = t;
        double r147639 = a;
        double r147640 = r147638 * r147639;
        double r147641 = r147637 - r147640;
        double r147642 = sqrt(r147641);
        double r147643 = r147636 / r147642;
        return r147643;
}

double f(double x, double y, double z, double t, double a) {
        double r147644 = z;
        double r147645 = -6.5067060621114526e+153;
        bool r147646 = r147644 <= r147645;
        double r147647 = y;
        double r147648 = x;
        double r147649 = r147647 * r147648;
        double r147650 = -r147649;
        double r147651 = 3.2435286845379817e+132;
        bool r147652 = r147644 <= r147651;
        double r147653 = r147644 * r147644;
        double r147654 = t;
        double r147655 = a;
        double r147656 = r147654 * r147655;
        double r147657 = r147653 - r147656;
        double r147658 = sqrt(r147657);
        double r147659 = cbrt(r147658);
        double r147660 = r147659 * r147659;
        double r147661 = cbrt(r147644);
        double r147662 = r147661 * r147661;
        double r147663 = r147660 / r147662;
        double r147664 = r147648 / r147663;
        double r147665 = r147659 / r147661;
        double r147666 = r147647 / r147665;
        double r147667 = r147664 * r147666;
        double r147668 = r147648 * r147647;
        double r147669 = r147652 ? r147667 : r147668;
        double r147670 = r147646 ? r147650 : r147669;
        return r147670;
}

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. Taylor expanded around -inf 0.9

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

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

    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}:\\ \;\;\;\;-y \cdot x\\ \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)))))