Average Error: 24.8 → 6.7
Time: 48.9s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -3078949553883556.0:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 4.540039934470349 \cdot 10^{+59}:\\ \;\;\;\;\frac{\frac{\frac{x \cdot y}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 - \frac{a \cdot \frac{1}{2}}{\frac{z \cdot z}{t}}}\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \le -3078949553883556.0:\\
\;\;\;\;-x \cdot y\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 - \frac{a \cdot \frac{1}{2}}{\frac{z \cdot z}{t}}}\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r8515691 = x;
        double r8515692 = y;
        double r8515693 = r8515691 * r8515692;
        double r8515694 = z;
        double r8515695 = r8515693 * r8515694;
        double r8515696 = r8515694 * r8515694;
        double r8515697 = t;
        double r8515698 = a;
        double r8515699 = r8515697 * r8515698;
        double r8515700 = r8515696 - r8515699;
        double r8515701 = sqrt(r8515700);
        double r8515702 = r8515695 / r8515701;
        return r8515702;
}

double f(double x, double y, double z, double t, double a) {
        double r8515703 = z;
        double r8515704 = -3078949553883556.0;
        bool r8515705 = r8515703 <= r8515704;
        double r8515706 = x;
        double r8515707 = y;
        double r8515708 = r8515706 * r8515707;
        double r8515709 = -r8515708;
        double r8515710 = 4.540039934470349e+59;
        bool r8515711 = r8515703 <= r8515710;
        double r8515712 = r8515703 * r8515703;
        double r8515713 = t;
        double r8515714 = a;
        double r8515715 = r8515713 * r8515714;
        double r8515716 = r8515712 - r8515715;
        double r8515717 = sqrt(r8515716);
        double r8515718 = cbrt(r8515717);
        double r8515719 = cbrt(r8515703);
        double r8515720 = r8515718 / r8515719;
        double r8515721 = r8515708 / r8515720;
        double r8515722 = r8515721 / r8515720;
        double r8515723 = r8515722 / r8515720;
        double r8515724 = 1.0;
        double r8515725 = 0.5;
        double r8515726 = r8515714 * r8515725;
        double r8515727 = r8515712 / r8515713;
        double r8515728 = r8515726 / r8515727;
        double r8515729 = r8515724 - r8515728;
        double r8515730 = r8515708 / r8515729;
        double r8515731 = r8515711 ? r8515723 : r8515730;
        double r8515732 = r8515705 ? r8515709 : r8515731;
        return r8515732;
}

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.8
Target7.7
Herbie6.7
\[\begin{array}{l} \mathbf{if}\;z \lt -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.976268120920894 \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 < -3078949553883556.0

    1. Initial program 35.2

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

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

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

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

    if -3078949553883556.0 < z < 4.540039934470349e+59

    1. Initial program 11.7

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

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

      \[\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-cbrt11.2

      \[\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-frac11.2

      \[\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 associate-/r*10.0

      \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\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}}}}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}\]
    9. Simplified10.0

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

    if 4.540039934470349e+59 < z

    1. Initial program 37.5

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 - \frac{1}{2} \cdot \frac{a \cdot t}{{z}^{2}}}}\]
    5. Simplified3.0

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 - \frac{\frac{1}{2} \cdot a}{\frac{z \cdot z}{t}}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -3078949553883556.0:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 4.540039934470349 \cdot 10^{+59}:\\ \;\;\;\;\frac{\frac{\frac{x \cdot y}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}{\frac{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 - \frac{a \cdot \frac{1}{2}}{\frac{z \cdot z}{t}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019156 
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"

  :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)))))