Average Error: 24.9 → 6.7
Time: 4.6s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -3.07723386361766317 \cdot 10^{167}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 6.12893967169521 \cdot 10^{-310}:\\ \;\;\;\;x \cdot \left(\left(y \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}\right)\\ \mathbf{elif}\;z \le 6.189477390780605 \cdot 10^{-86}:\\ \;\;\;\;\left(x \cdot \left(y \cdot \sqrt{z}\right)\right) \cdot \frac{\sqrt{z}}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \le 2.37057209909574748 \cdot 10^{108}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \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 -3.07723386361766317 \cdot 10^{167}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

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

\mathbf{elif}\;z \le 6.189477390780605 \cdot 10^{-86}:\\
\;\;\;\;\left(x \cdot \left(y \cdot \sqrt{z}\right)\right) \cdot \frac{\sqrt{z}}{\sqrt{z \cdot z - t \cdot a}}\\

\mathbf{elif}\;z \le 2.37057209909574748 \cdot 10^{108}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r288776 = x;
        double r288777 = y;
        double r288778 = r288776 * r288777;
        double r288779 = z;
        double r288780 = r288778 * r288779;
        double r288781 = r288779 * r288779;
        double r288782 = t;
        double r288783 = a;
        double r288784 = r288782 * r288783;
        double r288785 = r288781 - r288784;
        double r288786 = sqrt(r288785);
        double r288787 = r288780 / r288786;
        return r288787;
}

double f(double x, double y, double z, double t, double a) {
        double r288788 = z;
        double r288789 = -3.077233863617663e+167;
        bool r288790 = r288788 <= r288789;
        double r288791 = -1.0;
        double r288792 = x;
        double r288793 = y;
        double r288794 = r288792 * r288793;
        double r288795 = r288791 * r288794;
        double r288796 = 6.1289396716952e-310;
        bool r288797 = r288788 <= r288796;
        double r288798 = cbrt(r288788);
        double r288799 = r288798 * r288798;
        double r288800 = r288788 * r288788;
        double r288801 = t;
        double r288802 = a;
        double r288803 = r288801 * r288802;
        double r288804 = r288800 - r288803;
        double r288805 = sqrt(r288804);
        double r288806 = cbrt(r288805);
        double r288807 = r288806 * r288806;
        double r288808 = r288799 / r288807;
        double r288809 = r288793 * r288808;
        double r288810 = r288798 / r288806;
        double r288811 = r288809 * r288810;
        double r288812 = r288792 * r288811;
        double r288813 = 6.189477390780605e-86;
        bool r288814 = r288788 <= r288813;
        double r288815 = sqrt(r288788);
        double r288816 = r288793 * r288815;
        double r288817 = r288792 * r288816;
        double r288818 = r288815 / r288805;
        double r288819 = r288817 * r288818;
        double r288820 = 2.3705720990957475e+108;
        bool r288821 = r288788 <= r288820;
        double r288822 = r288788 / r288805;
        double r288823 = r288793 * r288822;
        double r288824 = r288792 * r288823;
        double r288825 = r288821 ? r288824 : r288794;
        double r288826 = r288814 ? r288819 : r288825;
        double r288827 = r288797 ? r288812 : r288826;
        double r288828 = r288790 ? r288795 : r288827;
        return r288828;
}

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.9
Target7.6
Herbie6.7
\[\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 5 regimes
  2. if z < -3.077233863617663e+167

    1. Initial program 53.5

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

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

    if -3.077233863617663e+167 < z < 6.1289396716952e-310

    1. Initial program 13.6

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity13.6

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified10.7

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied associate-*l*10.6

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    9. Using strategy rm
    10. Applied add-cube-cbrt11.3

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\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}}}}\right)\]
    11. Applied add-cube-cbrt10.9

      \[\leadsto x \cdot \left(y \cdot \frac{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}{\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}}}\right)\]
    12. Applied times-frac10.9

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

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

    if 6.1289396716952e-310 < z < 6.189477390780605e-86

    1. Initial program 15.7

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity15.7

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified15.5

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity15.5

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

      \[\leadsto \left(x \cdot y\right) \cdot \frac{z}{\color{blue}{\sqrt{1} \cdot \sqrt{z \cdot z - t \cdot a}}}\]
    10. Applied add-sqr-sqrt15.6

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

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

      \[\leadsto \color{blue}{\left(\left(x \cdot y\right) \cdot \frac{\sqrt{z}}{\sqrt{1}}\right) \cdot \frac{\sqrt{z}}{\sqrt{z \cdot z - t \cdot a}}}\]
    13. Simplified12.7

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

    if 6.189477390780605e-86 < z < 2.3705720990957475e+108

    1. Initial program 7.1

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity7.1

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified4.8

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied associate-*l*4.7

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

    if 2.3705720990957475e+108 < z

    1. Initial program 44.5

      \[\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}{x \cdot y}\]
  3. Recombined 5 regimes into one program.
  4. Final simplification6.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -3.07723386361766317 \cdot 10^{167}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 6.12893967169521 \cdot 10^{-310}:\\ \;\;\;\;x \cdot \left(\left(y \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{\sqrt{z \cdot z - t \cdot a}}}\right)\\ \mathbf{elif}\;z \le 6.189477390780605 \cdot 10^{-86}:\\ \;\;\;\;\left(x \cdot \left(y \cdot \sqrt{z}\right)\right) \cdot \frac{\sqrt{z}}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \le 2.37057209909574748 \cdot 10^{108}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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