Average Error: 24.6 → 7.5
Time: 7.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 -1.16524733009835821 \cdot 10^{113}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 3.90238105065629941 \cdot 10^{82}:\\ \;\;\;\;\left(\frac{x}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}} \cdot \frac{1}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\\ \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.16524733009835821 \cdot 10^{113}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 3.90238105065629941 \cdot 10^{82}:\\
\;\;\;\;\left(\frac{x}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}} \cdot \frac{1}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r304655 = x;
        double r304656 = y;
        double r304657 = r304655 * r304656;
        double r304658 = z;
        double r304659 = r304657 * r304658;
        double r304660 = r304658 * r304658;
        double r304661 = t;
        double r304662 = a;
        double r304663 = r304661 * r304662;
        double r304664 = r304660 - r304663;
        double r304665 = sqrt(r304664);
        double r304666 = r304659 / r304665;
        return r304666;
}

double f(double x, double y, double z, double t, double a) {
        double r304667 = z;
        double r304668 = -1.1652473300983582e+113;
        bool r304669 = r304667 <= r304668;
        double r304670 = -1.0;
        double r304671 = x;
        double r304672 = y;
        double r304673 = r304671 * r304672;
        double r304674 = r304670 * r304673;
        double r304675 = 3.9023810506562994e+82;
        bool r304676 = r304667 <= r304675;
        double r304677 = r304667 * r304667;
        double r304678 = t;
        double r304679 = a;
        double r304680 = r304678 * r304679;
        double r304681 = r304677 - r304680;
        double r304682 = cbrt(r304681);
        double r304683 = fabs(r304682);
        double r304684 = sqrt(r304683);
        double r304685 = r304671 / r304684;
        double r304686 = 1.0;
        double r304687 = r304684 / r304672;
        double r304688 = r304686 / r304687;
        double r304689 = r304685 * r304688;
        double r304690 = sqrt(r304682);
        double r304691 = r304667 / r304690;
        double r304692 = r304689 * r304691;
        double r304693 = r304676 ? r304692 : r304673;
        double r304694 = r304669 ? r304674 : r304693;
        return r304694;
}

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.0
Herbie7.5
\[\begin{array}{l} \mathbf{if}\;z \lt -3.1921305903852764 \cdot 10^{46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.9762681209208942 \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.1652473300983582e+113

    1. Initial program 45.0

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Taylor expanded around -inf 1.9

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

    if -1.1652473300983582e+113 < z < 3.9023810506562994e+82

    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 add-cube-cbrt11.8

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}{y}}} \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    7. Using strategy rm
    8. Applied div-inv11.8

      \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\frac{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}{y}}\right)} \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    9. Using strategy rm
    10. Applied *-un-lft-identity11.8

      \[\leadsto \left(x \cdot \frac{1}{\frac{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}{\color{blue}{1 \cdot y}}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    11. Applied add-sqr-sqrt11.9

      \[\leadsto \left(x \cdot \frac{1}{\frac{\color{blue}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|} \cdot \sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}}{1 \cdot y}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    12. Applied times-frac11.9

      \[\leadsto \left(x \cdot \frac{1}{\color{blue}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{1} \cdot \frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    13. Applied *-un-lft-identity11.9

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

      \[\leadsto \left(x \cdot \color{blue}{\left(\frac{1}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{1}} \cdot \frac{1}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}\right)}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    15. Applied associate-*r*11.4

      \[\leadsto \color{blue}{\left(\left(x \cdot \frac{1}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{1}}\right) \cdot \frac{1}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}\right)} \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    16. Simplified11.4

      \[\leadsto \left(\color{blue}{\frac{x}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}} \cdot \frac{1}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]

    if 3.9023810506562994e+82 < z

    1. Initial program 40.6

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Taylor expanded around inf 2.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.16524733009835821 \cdot 10^{113}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 3.90238105065629941 \cdot 10^{82}:\\ \;\;\;\;\left(\frac{x}{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}} \cdot \frac{1}{\frac{\sqrt{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}}{y}}\right) \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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