Average Error: 24.5 → 6.2
Time: 15.8s
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.56669606928412226714024442258344220631 \cdot 10^{139}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 3.933727440559583419850245795816023246332 \cdot 10^{69}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot 1\right)\\ \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.56669606928412226714024442258344220631 \cdot 10^{139}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot 1\right)\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r259666 = x;
        double r259667 = y;
        double r259668 = r259666 * r259667;
        double r259669 = z;
        double r259670 = r259668 * r259669;
        double r259671 = r259669 * r259669;
        double r259672 = t;
        double r259673 = a;
        double r259674 = r259672 * r259673;
        double r259675 = r259671 - r259674;
        double r259676 = sqrt(r259675);
        double r259677 = r259670 / r259676;
        return r259677;
}

double f(double x, double y, double z, double t, double a) {
        double r259678 = z;
        double r259679 = -6.566696069284122e+139;
        bool r259680 = r259678 <= r259679;
        double r259681 = -1.0;
        double r259682 = x;
        double r259683 = y;
        double r259684 = r259682 * r259683;
        double r259685 = r259681 * r259684;
        double r259686 = 3.9337274405595834e+69;
        bool r259687 = r259678 <= r259686;
        double r259688 = r259678 * r259678;
        double r259689 = t;
        double r259690 = a;
        double r259691 = r259689 * r259690;
        double r259692 = r259688 - r259691;
        double r259693 = sqrt(r259692);
        double r259694 = r259678 / r259693;
        double r259695 = r259683 * r259694;
        double r259696 = r259682 * r259695;
        double r259697 = 1.0;
        double r259698 = r259683 * r259697;
        double r259699 = r259682 * r259698;
        double r259700 = r259687 ? r259696 : r259699;
        double r259701 = r259680 ? r259685 : r259700;
        return r259701;
}

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.7
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 < -6.566696069284122e+139

    1. Initial program 50.2

      \[\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)}\]

    if -6.566696069284122e+139 < z < 3.9337274405595834e+69

    1. Initial program 11.2

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

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

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

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

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

    if 3.9337274405595834e+69 < z

    1. Initial program 38.7

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    8. Taylor expanded around inf 2.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -6.56669606928412226714024442258344220631 \cdot 10^{139}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 3.933727440559583419850245795816023246332 \cdot 10^{69}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot 1\right)\\ \end{array}\]

Reproduce

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