Average Error: 24.0 → 6.2
Time: 18.0s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.37356901340721276315596241277867151448 \cdot 10^{144}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 1.188073154399654890634910572185761354092 \cdot 10^{66}:\\ \;\;\;\;\frac{x}{\frac{\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{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 -5.37356901340721276315596241277867151448 \cdot 10^{144}:\\
\;\;\;\;-x \cdot y\\

\mathbf{elif}\;z \le 1.188073154399654890634910572185761354092 \cdot 10^{66}:\\
\;\;\;\;\frac{x}{\frac{\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{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 r184017 = x;
        double r184018 = y;
        double r184019 = r184017 * r184018;
        double r184020 = z;
        double r184021 = r184019 * r184020;
        double r184022 = r184020 * r184020;
        double r184023 = t;
        double r184024 = a;
        double r184025 = r184023 * r184024;
        double r184026 = r184022 - r184025;
        double r184027 = sqrt(r184026);
        double r184028 = r184021 / r184027;
        return r184028;
}

double f(double x, double y, double z, double t, double a) {
        double r184029 = z;
        double r184030 = -5.373569013407213e+144;
        bool r184031 = r184029 <= r184030;
        double r184032 = x;
        double r184033 = y;
        double r184034 = r184032 * r184033;
        double r184035 = -r184034;
        double r184036 = 1.1880731543996549e+66;
        bool r184037 = r184029 <= r184036;
        double r184038 = r184029 * r184029;
        double r184039 = t;
        double r184040 = a;
        double r184041 = r184039 * r184040;
        double r184042 = r184038 - r184041;
        double r184043 = sqrt(r184042);
        double r184044 = cbrt(r184043);
        double r184045 = r184044 * r184044;
        double r184046 = cbrt(r184029);
        double r184047 = r184046 * r184046;
        double r184048 = r184045 / r184047;
        double r184049 = r184044 / r184046;
        double r184050 = r184033 / r184049;
        double r184051 = r184048 / r184050;
        double r184052 = r184032 / r184051;
        double r184053 = r184037 ? r184052 : r184034;
        double r184054 = r184031 ? r184035 : r184053;
        return r184054;
}

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.0
Target7.6
Herbie6.2
\[\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 < -5.373569013407213e+144

    1. Initial program 50.5

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

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

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

    if -5.373569013407213e+144 < z < 1.1880731543996549e+66

    1. Initial program 10.6

      \[\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 associate-/l*9.2

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

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

      \[\leadsto \frac{x}{\frac{\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}}}{y}}\]
    9. Applied times-frac9.5

      \[\leadsto \frac{x}{\frac{\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}}}}{y}}\]
    10. Applied associate-/l*8.7

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

    if 1.1880731543996549e+66 < z

    1. Initial program 39.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.37356901340721276315596241277867151448 \cdot 10^{144}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 1.188073154399654890634910572185761354092 \cdot 10^{66}:\\ \;\;\;\;\frac{x}{\frac{\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{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 2019306 
(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)))))