Average Error: 25.2 → 6.8
Time: 6.3s
Precision: binary64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \leq -7.285238985507498 \cdot 10^{+137}:\\ \;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}{z}}\\ \mathbf{elif}\;z \leq 1.5076725501489753 \cdot 10^{+41}:\\ \;\;\;\;\frac{x \cdot y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{z + \left(\frac{a}{z} \cdot t\right) \cdot -0.5}\right)\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \leq -7.285238985507498 \cdot 10^{+137}:\\
\;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}{z}}\\

\mathbf{elif}\;z \leq 1.5076725501489753 \cdot 10^{+41}:\\
\;\;\;\;\frac{x \cdot y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{z + \left(\frac{a}{z} \cdot t\right) \cdot -0.5}\right)\\

\end{array}
double code(double x, double y, double z, double t, double a) {
	return (((double) (((double) (x * y)) * z)) / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((z <= -7.285238985507498e+137)) {
		VAR = (((double) (x * y)) / (((double) (((double) (0.5 * ((double) ((a / z) * t)))) - z)) / z));
	} else {
		double VAR_1;
		if ((z <= 1.5076725501489753e+41)) {
			VAR_1 = (((double) (x * y)) / (((double) sqrt(((double) (((double) (z * z)) - ((double) (a * t)))))) / z));
		} else {
			VAR_1 = ((double) (x * ((double) (y * (z / ((double) (z + ((double) (((double) ((a / z) * t)) * -0.5)))))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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

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

    1. Initial program Error: 49.7 bits

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. SimplifiedError: 48.6 bits

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    3. Using strategy rm
    4. Applied associate-*r*Error: 48.6 bits

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    5. Using strategy rm
    6. Applied clear-numError: 48.6 bits

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    7. Using strategy rm
    8. Applied un-div-invError: 48.6 bits

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    9. Taylor expanded around -inf Error: 5.0 bits

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{0.5 \cdot \frac{a \cdot t}{z} - z}}{z}}\]
    10. SimplifiedError: 1.6 bits

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

    if -7.28523898550749776e137 < z < 1.5076725501489753e41

    1. Initial program Error: 11.3 bits

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. SimplifiedError: 10.0 bits

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    3. Using strategy rm
    4. Applied associate-*r*Error: 9.9 bits

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    5. Using strategy rm
    6. Applied clear-numError: 10.1 bits

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    7. Using strategy rm
    8. Applied un-div-invError: 10.1 bits

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

    if 1.5076725501489753e41 < z

    1. Initial program Error: 37.2 bits

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. SimplifiedError: 34.7 bits

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    3. Taylor expanded around inf Error: 6.3 bits

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\color{blue}{z - 0.5 \cdot \frac{a \cdot t}{z}}}\right)\]
    4. SimplifiedError: 3.4 bits

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\color{blue}{z + \left(t \cdot \frac{a}{z}\right) \cdot -0.5}}\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplificationError: 6.8 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.285238985507498 \cdot 10^{+137}:\\ \;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}{z}}\\ \mathbf{elif}\;z \leq 1.5076725501489753 \cdot 10^{+41}:\\ \;\;\;\;\frac{x \cdot y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{z + \left(\frac{a}{z} \cdot t\right) \cdot -0.5}\right)\\ \end{array}\]

Reproduce

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