Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2

Percentage Accurate: 61.1% → 91.4%
Time: 12.0s
Alternatives: 10
Speedup: 7.5×

Specification

?
\[\begin{array}{l} \\ \frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a):
	return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a))))
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) * z) / sqrt(((z * z) - (t * a)));
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]
\begin{array}{l}

\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 61.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a):
	return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a))))
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) * z) / sqrt(((z * z) - (t * a)));
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]
\begin{array}{l}

\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}

Alternative 1: 91.4% accurate, 0.2× speedup?

\[\begin{array}{l} z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := \frac{\left(x\_m \cdot y\_m\right) \cdot z\_m}{\sqrt{z\_m \cdot z\_m - t \cdot a}}\\ t_2 := \sqrt{\mathsf{fma}\left(-a, t, z\_m \cdot z\_m\right)}\\ t_3 := \frac{z\_m}{\mathsf{fma}\left(-0.5 \cdot \frac{a}{z\_m}, t, z\_m\right)}\\ x\_s \cdot \left(y\_s \cdot \left(z\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq 10^{-296}:\\ \;\;\;\;\left(x\_m \cdot y\_m\right) \cdot t\_3\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-63}:\\ \;\;\;\;\frac{x\_m \cdot y\_m}{t\_2} \cdot z\_m\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\left(\frac{z\_m}{t\_2} \cdot x\_m\right) \cdot y\_m\\ \mathbf{else}:\\ \;\;\;\;\left(t\_3 \cdot x\_m\right) \cdot y\_m\\ \end{array}\right)\right) \end{array} \end{array} \]
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s y_s z_s x_m y_m z_m t a)
 :precision binary64
 (let* ((t_1 (/ (* (* x_m y_m) z_m) (sqrt (- (* z_m z_m) (* t a)))))
        (t_2 (sqrt (fma (- a) t (* z_m z_m))))
        (t_3 (/ z_m (fma (* -0.5 (/ a z_m)) t z_m))))
   (*
    x_s
    (*
     y_s
     (*
      z_s
      (if (<= t_1 1e-296)
        (* (* x_m y_m) t_3)
        (if (<= t_1 5e-63)
          (* (/ (* x_m y_m) t_2) z_m)
          (if (<= t_1 INFINITY)
            (* (* (/ z_m t_2) x_m) y_m)
            (* (* t_3 x_m) y_m)))))))))
z\_m = fabs(z);
z\_s = copysign(1.0, z);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double y_s, double z_s, double x_m, double y_m, double z_m, double t, double a) {
	double t_1 = ((x_m * y_m) * z_m) / sqrt(((z_m * z_m) - (t * a)));
	double t_2 = sqrt(fma(-a, t, (z_m * z_m)));
	double t_3 = z_m / fma((-0.5 * (a / z_m)), t, z_m);
	double tmp;
	if (t_1 <= 1e-296) {
		tmp = (x_m * y_m) * t_3;
	} else if (t_1 <= 5e-63) {
		tmp = ((x_m * y_m) / t_2) * z_m;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = ((z_m / t_2) * x_m) * y_m;
	} else {
		tmp = (t_3 * x_m) * y_m;
	}
	return x_s * (y_s * (z_s * tmp));
}
z\_m = abs(z)
z\_s = copysign(1.0, z)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, y_s, z_s, x_m, y_m, z_m, t, a)
	t_1 = Float64(Float64(Float64(x_m * y_m) * z_m) / sqrt(Float64(Float64(z_m * z_m) - Float64(t * a))))
	t_2 = sqrt(fma(Float64(-a), t, Float64(z_m * z_m)))
	t_3 = Float64(z_m / fma(Float64(-0.5 * Float64(a / z_m)), t, z_m))
	tmp = 0.0
	if (t_1 <= 1e-296)
		tmp = Float64(Float64(x_m * y_m) * t_3);
	elseif (t_1 <= 5e-63)
		tmp = Float64(Float64(Float64(x_m * y_m) / t_2) * z_m);
	elseif (t_1 <= Inf)
		tmp = Float64(Float64(Float64(z_m / t_2) * x_m) * y_m);
	else
		tmp = Float64(Float64(t_3 * x_m) * y_m);
	end
	return Float64(x_s * Float64(y_s * Float64(z_s * tmp)))
end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, y$95$s_, z$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x$95$m * y$95$m), $MachinePrecision] * z$95$m), $MachinePrecision] / N[Sqrt[N[(N[(z$95$m * z$95$m), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[((-a) * t + N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(z$95$m / N[(N[(-0.5 * N[(a / z$95$m), $MachinePrecision]), $MachinePrecision] * t + z$95$m), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * N[(y$95$s * N[(z$95$s * If[LessEqual[t$95$1, 1e-296], N[(N[(x$95$m * y$95$m), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[t$95$1, 5e-63], N[(N[(N[(x$95$m * y$95$m), $MachinePrecision] / t$95$2), $MachinePrecision] * z$95$m), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(z$95$m / t$95$2), $MachinePrecision] * x$95$m), $MachinePrecision] * y$95$m), $MachinePrecision], N[(N[(t$95$3 * x$95$m), $MachinePrecision] * y$95$m), $MachinePrecision]]]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_1 := \frac{\left(x\_m \cdot y\_m\right) \cdot z\_m}{\sqrt{z\_m \cdot z\_m - t \cdot a}}\\
t_2 := \sqrt{\mathsf{fma}\left(-a, t, z\_m \cdot z\_m\right)}\\
t_3 := \frac{z\_m}{\mathsf{fma}\left(-0.5 \cdot \frac{a}{z\_m}, t, z\_m\right)}\\
x\_s \cdot \left(y\_s \cdot \left(z\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 10^{-296}:\\
\;\;\;\;\left(x\_m \cdot y\_m\right) \cdot t\_3\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-63}:\\
\;\;\;\;\frac{x\_m \cdot y\_m}{t\_2} \cdot z\_m\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(\frac{z\_m}{t\_2} \cdot x\_m\right) \cdot y\_m\\

\mathbf{else}:\\
\;\;\;\;\left(t\_3 \cdot x\_m\right) \cdot y\_m\\


\end{array}\right)\right)
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) < 1e-296

    1. Initial program 48.0%

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

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{z + \frac{-1}{2} \cdot \frac{a \cdot t}{z}}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\frac{-1}{2} \cdot \frac{a \cdot t}{z} + z}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\frac{\frac{-1}{2} \cdot \left(a \cdot t\right)}{z}} + z} \]
      3. associate-*r*N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\frac{\color{blue}{\left(\frac{-1}{2} \cdot a\right) \cdot t}}{z} + z} \]
      4. associate-*l/N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\frac{\frac{-1}{2} \cdot a}{z} \cdot t} + z} \]
      5. associate-*r/N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\left(\frac{-1}{2} \cdot \frac{a}{z}\right)} \cdot t + z} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{t \cdot \left(\frac{-1}{2} \cdot \frac{a}{z}\right)} + z} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\left(t \cdot \frac{-1}{2}\right) \cdot \frac{a}{z}} + z} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\left(\frac{-1}{2} \cdot t\right)} \cdot \frac{a}{z} + z} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)}} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot t}, \frac{a}{z}, z\right)} \]
      11. lower-/.f6486.9

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\mathsf{fma}\left(-0.5 \cdot t, \color{blue}{\frac{a}{z}}, z\right)} \]
    5. Applied rewrites86.9%

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\mathsf{fma}\left(-0.5 \cdot t, \frac{a}{z}, z\right)}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot y\right) \cdot z}}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \cdot \left(x \cdot y\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \cdot \left(x \cdot y\right)} \]
      6. lower-/.f6489.9

        \[\leadsto \color{blue}{\frac{z}{\mathsf{fma}\left(-0.5 \cdot t, \frac{a}{z}, z\right)}} \cdot \left(x \cdot y\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{z}{\mathsf{fma}\left(\mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{a}{z} \cdot \frac{-1}{2}\right)\right), t, z\right)} \cdot \color{blue}{\left(x \cdot y\right)} \]
      8. *-commutativeN/A

        \[\leadsto \frac{z}{\mathsf{fma}\left(\mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{a}{z} \cdot \frac{-1}{2}\right)\right), t, z\right)} \cdot \color{blue}{\left(y \cdot x\right)} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{z}{\mathsf{fma}\left(\mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{a}{z} \cdot \frac{-1}{2}\right)\right), t, z\right)} \cdot \color{blue}{\left(y \cdot x\right)} \]
    7. Applied rewrites89.9%

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

    if 1e-296 < (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) < 5.0000000000000002e-63

    1. Initial program 98.6%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \frac{\color{blue}{z \cdot \left(x \cdot y\right)}}{\sqrt{z \cdot z - t \cdot a}} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{z \cdot \frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}} \cdot z} \]
      7. lower-/.f6497.9

        \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{z \cdot z - t \cdot a}}} \cdot z \]
      8. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      9. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      10. lower-*.f6497.9

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\sqrt{z \cdot z - t \cdot a}} \cdot z \]
      11. lift--.f64N/A

        \[\leadsto \frac{y \cdot x}{\sqrt{\color{blue}{z \cdot z - t \cdot a}}} \cdot z \]
      12. sub-negN/A

        \[\leadsto \frac{y \cdot x}{\sqrt{\color{blue}{z \cdot z + \left(\mathsf{neg}\left(t \cdot a\right)\right)}}} \cdot z \]
      13. +-commutativeN/A

        \[\leadsto \frac{y \cdot x}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(t \cdot a\right)\right) + z \cdot z}}} \cdot z \]
      14. lift-*.f64N/A

        \[\leadsto \frac{y \cdot x}{\sqrt{\left(\mathsf{neg}\left(\color{blue}{t \cdot a}\right)\right) + z \cdot z}} \cdot z \]
      15. *-commutativeN/A

        \[\leadsto \frac{y \cdot x}{\sqrt{\left(\mathsf{neg}\left(\color{blue}{a \cdot t}\right)\right) + z \cdot z}} \cdot z \]
      16. distribute-lft-neg-inN/A

        \[\leadsto \frac{y \cdot x}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot t} + z \cdot z}} \cdot z \]
      17. lower-fma.f64N/A

        \[\leadsto \frac{y \cdot x}{\sqrt{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(a\right), t, z \cdot z\right)}}} \cdot z \]
      18. lower-neg.f6497.9

        \[\leadsto \frac{y \cdot x}{\sqrt{\mathsf{fma}\left(\color{blue}{-a}, t, z \cdot z\right)}} \cdot z \]
    4. Applied rewrites97.9%

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

    if 5.0000000000000002e-63 < (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a)))) < +inf.0

    1. Initial program 76.6%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot y\right) \cdot z}}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      4. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      6. associate-*l*N/A

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      7. *-commutativeN/A

        \[\leadsto \color{blue}{\left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right) \cdot y} \]
      8. lower-*.f64N/A

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

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

    if +inf.0 < (/.f64 (*.f64 (*.f64 x y) z) (sqrt.f64 (-.f64 (*.f64 z z) (*.f64 t a))))

    1. Initial program 0.0%

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

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{z + \frac{-1}{2} \cdot \frac{a \cdot t}{z}}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\frac{-1}{2} \cdot \frac{a \cdot t}{z} + z}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\frac{\frac{-1}{2} \cdot \left(a \cdot t\right)}{z}} + z} \]
      3. associate-*r*N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\frac{\color{blue}{\left(\frac{-1}{2} \cdot a\right) \cdot t}}{z} + z} \]
      4. associate-*l/N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\frac{\frac{-1}{2} \cdot a}{z} \cdot t} + z} \]
      5. associate-*r/N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\left(\frac{-1}{2} \cdot \frac{a}{z}\right)} \cdot t + z} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{t \cdot \left(\frac{-1}{2} \cdot \frac{a}{z}\right)} + z} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\left(t \cdot \frac{-1}{2}\right) \cdot \frac{a}{z}} + z} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\left(\frac{-1}{2} \cdot t\right)} \cdot \frac{a}{z} + z} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)}} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot t}, \frac{a}{z}, z\right)} \]
      11. lower-/.f6441.2

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\mathsf{fma}\left(-0.5 \cdot t, \color{blue}{\frac{a}{z}}, z\right)} \]
    5. Applied rewrites41.2%

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\mathsf{fma}\left(-0.5 \cdot t, \frac{a}{z}, z\right)}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot y\right) \cdot z}}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \cdot \left(x \cdot y\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \cdot \color{blue}{\left(x \cdot y\right)} \]
      6. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \cdot x\right) \cdot y} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \cdot x\right) \cdot y} \]
    7. Applied rewrites82.8%

      \[\leadsto \color{blue}{\left(\frac{z}{\mathsf{fma}\left(\frac{a}{z} \cdot -0.5, t, z\right)} \cdot x\right) \cdot y} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \leq 10^{-296}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{\mathsf{fma}\left(-0.5 \cdot \frac{a}{z}, t, z\right)}\\ \mathbf{elif}\;\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \leq 5 \cdot 10^{-63}:\\ \;\;\;\;\frac{x \cdot y}{\sqrt{\mathsf{fma}\left(-a, t, z \cdot z\right)}} \cdot z\\ \mathbf{elif}\;\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \leq \infty:\\ \;\;\;\;\left(\frac{z}{\sqrt{\mathsf{fma}\left(-a, t, z \cdot z\right)}} \cdot x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{z}{\mathsf{fma}\left(-0.5 \cdot \frac{a}{z}, t, z\right)} \cdot x\right) \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 91.3% accurate, 0.8× speedup?

\[\begin{array}{l} z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(y\_s \cdot \left(z\_s \cdot \begin{array}{l} \mathbf{if}\;z\_m \leq 5 \cdot 10^{-207}:\\ \;\;\;\;\frac{y\_m \cdot z\_m}{\sqrt{t \cdot \left(-a\right)}} \cdot x\_m\\ \mathbf{elif}\;z\_m \leq 2 \cdot 10^{+125}:\\ \;\;\;\;\left(\frac{z\_m}{\sqrt{\mathsf{fma}\left(-a, t, z\_m \cdot z\_m\right)}} \cdot x\_m\right) \cdot y\_m\\ \mathbf{else}:\\ \;\;\;\;\left(x\_m \cdot y\_m\right) \cdot \frac{z\_m}{\mathsf{fma}\left(-0.5 \cdot \frac{a}{z\_m}, t, z\_m\right)}\\ \end{array}\right)\right) \end{array} \]
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s y_s z_s x_m y_m z_m t a)
 :precision binary64
 (*
  x_s
  (*
   y_s
   (*
    z_s
    (if (<= z_m 5e-207)
      (* (/ (* y_m z_m) (sqrt (* t (- a)))) x_m)
      (if (<= z_m 2e+125)
        (* (* (/ z_m (sqrt (fma (- a) t (* z_m z_m)))) x_m) y_m)
        (* (* x_m y_m) (/ z_m (fma (* -0.5 (/ a z_m)) t z_m)))))))))
z\_m = fabs(z);
z\_s = copysign(1.0, z);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double y_s, double z_s, double x_m, double y_m, double z_m, double t, double a) {
	double tmp;
	if (z_m <= 5e-207) {
		tmp = ((y_m * z_m) / sqrt((t * -a))) * x_m;
	} else if (z_m <= 2e+125) {
		tmp = ((z_m / sqrt(fma(-a, t, (z_m * z_m)))) * x_m) * y_m;
	} else {
		tmp = (x_m * y_m) * (z_m / fma((-0.5 * (a / z_m)), t, z_m));
	}
	return x_s * (y_s * (z_s * tmp));
}
z\_m = abs(z)
z\_s = copysign(1.0, z)
y\_m = abs(y)
y\_s = copysign(1.0, y)
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, y_s, z_s, x_m, y_m, z_m, t, a)
	tmp = 0.0
	if (z_m <= 5e-207)
		tmp = Float64(Float64(Float64(y_m * z_m) / sqrt(Float64(t * Float64(-a)))) * x_m);
	elseif (z_m <= 2e+125)
		tmp = Float64(Float64(Float64(z_m / sqrt(fma(Float64(-a), t, Float64(z_m * z_m)))) * x_m) * y_m);
	else
		tmp = Float64(Float64(x_m * y_m) * Float64(z_m / fma(Float64(-0.5 * Float64(a / z_m)), t, z_m)));
	end
	return Float64(x_s * Float64(y_s * Float64(z_s * tmp)))
end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, y$95$s_, z$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(x$95$s * N[(y$95$s * N[(z$95$s * If[LessEqual[z$95$m, 5e-207], N[(N[(N[(y$95$m * z$95$m), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], If[LessEqual[z$95$m, 2e+125], N[(N[(N[(z$95$m / N[Sqrt[N[((-a) * t + N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision] * y$95$m), $MachinePrecision], N[(N[(x$95$m * y$95$m), $MachinePrecision] * N[(z$95$m / N[(N[(-0.5 * N[(a / z$95$m), $MachinePrecision]), $MachinePrecision] * t + z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \left(y\_s \cdot \left(z\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 5 \cdot 10^{-207}:\\
\;\;\;\;\frac{y\_m \cdot z\_m}{\sqrt{t \cdot \left(-a\right)}} \cdot x\_m\\

\mathbf{elif}\;z\_m \leq 2 \cdot 10^{+125}:\\
\;\;\;\;\left(\frac{z\_m}{\sqrt{\mathsf{fma}\left(-a, t, z\_m \cdot z\_m\right)}} \cdot x\_m\right) \cdot y\_m\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 5.00000000000000014e-207

    1. Initial program 72.7%

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

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{-1 \cdot \left(a \cdot t\right)}}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{-1 \cdot \color{blue}{\left(t \cdot a\right)}}} \]
      2. associate-*r*N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{\left(-1 \cdot t\right) \cdot a}}} \]
      3. lower-*.f64N/A

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

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot a}} \]
      5. lower-neg.f6472.4

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

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{\left(-t\right) \cdot a}}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot z}{\sqrt{\left(\mathsf{neg}\left(t\right)\right) \cdot a}}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot y\right) \cdot z}}{\sqrt{\left(\mathsf{neg}\left(t\right)\right) \cdot a}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot y\right)} \cdot z}{\sqrt{\left(\mathsf{neg}\left(t\right)\right) \cdot a}} \]
      4. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{x \cdot \left(y \cdot z\right)}}{\sqrt{\left(\mathsf{neg}\left(t\right)\right) \cdot a}} \]
      5. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{y \cdot z}{\sqrt{\left(\mathsf{neg}\left(t\right)\right) \cdot a}}} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \frac{y \cdot z}{\sqrt{\left(\mathsf{neg}\left(t\right)\right) \cdot a}}} \]
      7. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y \cdot z}{\sqrt{\left(\mathsf{neg}\left(t\right)\right) \cdot a}}} \]
      8. *-commutativeN/A

        \[\leadsto x \cdot \frac{\color{blue}{z \cdot y}}{\sqrt{\left(\mathsf{neg}\left(t\right)\right) \cdot a}} \]
      9. lower-*.f6474.3

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

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

    if 5.00000000000000014e-207 < z < 1.9999999999999998e125

    1. Initial program 86.2%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot y\right) \cdot z}}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      4. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      6. associate-*l*N/A

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      7. *-commutativeN/A

        \[\leadsto \color{blue}{\left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right) \cdot y} \]
      8. lower-*.f64N/A

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

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

    if 1.9999999999999998e125 < z

    1. Initial program 24.5%

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

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{z + \frac{-1}{2} \cdot \frac{a \cdot t}{z}}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\frac{-1}{2} \cdot \frac{a \cdot t}{z} + z}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\frac{\frac{-1}{2} \cdot \left(a \cdot t\right)}{z}} + z} \]
      3. associate-*r*N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\frac{\color{blue}{\left(\frac{-1}{2} \cdot a\right) \cdot t}}{z} + z} \]
      4. associate-*l/N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\frac{\frac{-1}{2} \cdot a}{z} \cdot t} + z} \]
      5. associate-*r/N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\left(\frac{-1}{2} \cdot \frac{a}{z}\right)} \cdot t + z} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{t \cdot \left(\frac{-1}{2} \cdot \frac{a}{z}\right)} + z} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\left(t \cdot \frac{-1}{2}\right) \cdot \frac{a}{z}} + z} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\left(\frac{-1}{2} \cdot t\right)} \cdot \frac{a}{z} + z} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)}} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot t}, \frac{a}{z}, z\right)} \]
      11. lower-/.f6475.7

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\mathsf{fma}\left(-0.5 \cdot t, \color{blue}{\frac{a}{z}}, z\right)} \]
    5. Applied rewrites75.7%

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\mathsf{fma}\left(-0.5 \cdot t, \frac{a}{z}, z\right)}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x \cdot y\right) \cdot z}}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \cdot \left(x \cdot y\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot t, \frac{a}{z}, z\right)} \cdot \left(x \cdot y\right)} \]
      6. lower-/.f6497.7

        \[\leadsto \color{blue}{\frac{z}{\mathsf{fma}\left(-0.5 \cdot t, \frac{a}{z}, z\right)}} \cdot \left(x \cdot y\right) \]
      7. lift-*.f64N/A

        \[\leadsto \frac{z}{\mathsf{fma}\left(\mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{a}{z} \cdot \frac{-1}{2}\right)\right), t, z\right)} \cdot \color{blue}{\left(x \cdot y\right)} \]
      8. *-commutativeN/A

        \[\leadsto \frac{z}{\mathsf{fma}\left(\mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{a}{z} \cdot \frac{-1}{2}\right)\right), t, z\right)} \cdot \color{blue}{\left(y \cdot x\right)} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{z}{\mathsf{fma}\left(\mathsf{Rewrite=>}\left(lower-*.f64, \left(\frac{a}{z} \cdot \frac{-1}{2}\right)\right), t, z\right)} \cdot \color{blue}{\left(y \cdot x\right)} \]
    7. Applied rewrites97.7%

      \[\leadsto \color{blue}{\frac{z}{\mathsf{fma}\left(\frac{a}{z} \cdot -0.5, t, z\right)} \cdot \left(y \cdot x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification91.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 5 \cdot 10^{-207}:\\ \;\;\;\;\frac{y \cdot z}{\sqrt{t \cdot \left(-a\right)}} \cdot x\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+125}:\\ \;\;\;\;\left(\frac{z}{\sqrt{\mathsf{fma}\left(-a, t, z \cdot z\right)}} \cdot x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{\mathsf{fma}\left(-0.5 \cdot \frac{a}{z}, t, z\right)}\\ \end{array} \]
  5. Add Preprocessing

Developer Target 1: 89.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \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} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (< z -3.1921305903852764e+46)
   (- (* y x))
   (if (< z 5.976268120920894e+90)
     (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
     (* y x))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z < -3.1921305903852764e+46) {
		tmp = -(y * x);
	} else if (z < 5.976268120920894e+90) {
		tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
	} else {
		tmp = y * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z < (-3.1921305903852764d+46)) then
        tmp = -(y * x)
    else if (z < 5.976268120920894d+90) then
        tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
    else
        tmp = y * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z < -3.1921305903852764e+46) {
		tmp = -(y * x);
	} else if (z < 5.976268120920894e+90) {
		tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
	} else {
		tmp = y * x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z < -3.1921305903852764e+46:
		tmp = -(y * x)
	elif z < 5.976268120920894e+90:
		tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y)
	else:
		tmp = y * x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z < -3.1921305903852764e+46)
		tmp = Float64(-Float64(y * x));
	elseif (z < 5.976268120920894e+90)
		tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y));
	else
		tmp = Float64(y * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z < -3.1921305903852764e+46)
		tmp = -(y * x);
	elseif (z < 5.976268120920894e+90)
		tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
	else
		tmp = y * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}

\\
\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}
\end{array}

Reproduce

?
herbie shell --seed 2024230 
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -31921305903852764000000000000000000000000000000) (- (* y x)) (if (< z 5976268120920894000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x))))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))