Average Error: 24.6 → 4.0
Time: 10.2s
Precision: binary64
\[[x, y] = \mathsf{sort}([x, y]) \[t, a] = \mathsf{sort}([t, a]) \\]
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
\[\begin{array}{l} t_1 := \sqrt{z \cdot z - t \cdot a}\\ t_2 := \sqrt{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)}\\ \mathbf{if}\;z \leq -1.3347213958553576 \cdot 10^{+154}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \leq -5.158443679629766 \cdot 10^{-164}:\\ \;\;\;\;\frac{y \cdot x}{\frac{t_1}{z}}\\ \mathbf{elif}\;z \leq 7.581764408590992 \cdot 10^{-115}:\\ \;\;\;\;\frac{x}{\frac{t_2}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{t_2}{\sqrt[3]{z}}}\\ \mathbf{elif}\;z \leq 7.57008347475156 \cdot 10^{+58}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{t_1}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (sqrt (- (* z z) (* t a))))
        (t_2 (sqrt (hypot (* (sqrt a) (sqrt (- t))) z))))
   (if (<= z -1.3347213958553576e+154)
     (- (* y x))
     (if (<= z -5.158443679629766e-164)
       (/ (* y x) (/ t_1 z))
       (if (<= z 7.581764408590992e-115)
         (* (/ x (/ t_2 (* (cbrt z) (cbrt z)))) (/ y (/ t_2 (cbrt z))))
         (if (<= z 7.57008347475156e+58) (* (* y x) (/ z t_1)) (* y x)))))))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
double code(double x, double y, double z, double t, double a) {
	double t_1 = sqrt(((z * z) - (t * a)));
	double t_2 = sqrt(hypot((sqrt(a) * sqrt(-t)), z));
	double tmp;
	if (z <= -1.3347213958553576e+154) {
		tmp = -(y * x);
	} else if (z <= -5.158443679629766e-164) {
		tmp = (y * x) / (t_1 / z);
	} else if (z <= 7.581764408590992e-115) {
		tmp = (x / (t_2 / (cbrt(z) * cbrt(z)))) * (y / (t_2 / cbrt(z)));
	} else if (z <= 7.57008347475156e+58) {
		tmp = (y * x) * (z / t_1);
	} else {
		tmp = y * x;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = Math.sqrt(((z * z) - (t * a)));
	double t_2 = Math.sqrt(Math.hypot((Math.sqrt(a) * Math.sqrt(-t)), z));
	double tmp;
	if (z <= -1.3347213958553576e+154) {
		tmp = -(y * x);
	} else if (z <= -5.158443679629766e-164) {
		tmp = (y * x) / (t_1 / z);
	} else if (z <= 7.581764408590992e-115) {
		tmp = (x / (t_2 / (Math.cbrt(z) * Math.cbrt(z)))) * (y / (t_2 / Math.cbrt(z)));
	} else if (z <= 7.57008347475156e+58) {
		tmp = (y * x) * (z / t_1);
	} else {
		tmp = y * x;
	}
	return tmp;
}
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a))))
end
function code(x, y, z, t, a)
	t_1 = sqrt(Float64(Float64(z * z) - Float64(t * a)))
	t_2 = sqrt(hypot(Float64(sqrt(a) * sqrt(Float64(-t))), z))
	tmp = 0.0
	if (z <= -1.3347213958553576e+154)
		tmp = Float64(-Float64(y * x));
	elseif (z <= -5.158443679629766e-164)
		tmp = Float64(Float64(y * x) / Float64(t_1 / z));
	elseif (z <= 7.581764408590992e-115)
		tmp = Float64(Float64(x / Float64(t_2 / Float64(cbrt(z) * cbrt(z)))) * Float64(y / Float64(t_2 / cbrt(z))));
	elseif (z <= 7.57008347475156e+58)
		tmp = Float64(Float64(y * x) * Float64(z / t_1));
	else
		tmp = Float64(y * x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[Sqrt[N[(N[Sqrt[a], $MachinePrecision] * N[Sqrt[(-t)], $MachinePrecision]), $MachinePrecision] ^ 2 + z ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.3347213958553576e+154], (-N[(y * x), $MachinePrecision]), If[LessEqual[z, -5.158443679629766e-164], N[(N[(y * x), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.581764408590992e-115], N[(N[(x / N[(t$95$2 / N[(N[Power[z, 1/3], $MachinePrecision] * N[Power[z, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(t$95$2 / N[Power[z, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.57008347475156e+58], N[(N[(y * x), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]]]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
t_1 := \sqrt{z \cdot z - t \cdot a}\\
t_2 := \sqrt{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)}\\
\mathbf{if}\;z \leq -1.3347213958553576 \cdot 10^{+154}:\\
\;\;\;\;-y \cdot x\\

\mathbf{elif}\;z \leq -5.158443679629766 \cdot 10^{-164}:\\
\;\;\;\;\frac{y \cdot x}{\frac{t_1}{z}}\\

\mathbf{elif}\;z \leq 7.581764408590992 \cdot 10^{-115}:\\
\;\;\;\;\frac{x}{\frac{t_2}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{t_2}{\sqrt[3]{z}}}\\

\mathbf{elif}\;z \leq 7.57008347475156 \cdot 10^{+58}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{t_1}\\

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


\end{array}

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
Target7.5
Herbie4.0
\[\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 5 regimes
  2. if z < -1.33472139585535758e154

    1. Initial program 54.0

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

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

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

    if -1.33472139585535758e154 < z < -5.15844367962976623e-164

    1. Initial program 9.6

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Applied associate-/l*_binary645.1

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

    if -5.15844367962976623e-164 < z < 7.58176440859099234e-115

    1. Initial program 17.6

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Applied associate-/l*_binary6417.3

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{\frac{\mathsf{hypot}\left(\sqrt{-a \cdot t}, z\right)}{z}}} \]
    4. Applied distribute-rgt-neg-in_binary6413.9

      \[\leadsto \frac{x \cdot y}{\frac{\mathsf{hypot}\left(\sqrt{\color{blue}{a \cdot \left(-t\right)}}, z\right)}{z}} \]
    5. Applied sqrt-prod_binary6412.3

      \[\leadsto \frac{x \cdot y}{\frac{\mathsf{hypot}\left(\color{blue}{\sqrt{a} \cdot \sqrt{-t}}, z\right)}{z}} \]
    6. Applied add-cube-cbrt_binary6412.8

      \[\leadsto \frac{x \cdot y}{\frac{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}} \]
    7. Applied add-sqr-sqrt_binary6412.8

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{\sqrt{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)} \cdot \sqrt{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} \]
    8. Applied times-frac_binary6412.8

      \[\leadsto \frac{x \cdot y}{\color{blue}{\frac{\sqrt{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)}}{\sqrt[3]{z}}}} \]
    9. Applied times-frac_binary646.3

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

    if 7.58176440859099234e-115 < z < 7.57008347475155985e58

    1. Initial program 4.5

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Applied *-un-lft-identity_binary644.5

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

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

    if 7.57008347475155985e58 < z

    1. Initial program 38.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3347213958553576 \cdot 10^{+154}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \leq -5.158443679629766 \cdot 10^{-164}:\\ \;\;\;\;\frac{y \cdot x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\ \mathbf{elif}\;z \leq 7.581764408590992 \cdot 10^{-115}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)}}{\sqrt[3]{z}}}\\ \mathbf{elif}\;z \leq 7.57008347475156 \cdot 10^{+58}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Reproduce

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