Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B

Percentage Accurate: 89.9% → 95.4%
Time: 13.6s
Alternatives: 9
Speedup: 0.8×

Specification

?
\[\begin{array}{l} \\ x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
double code(double x, double y, double z, double t) {
	return (x * x) - ((y * 4.0) * ((z * z) - t));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * x) - ((y * 4.0d0) * ((z * z) - t))
end function
public static double code(double x, double y, double z, double t) {
	return (x * x) - ((y * 4.0) * ((z * z) - t));
}
def code(x, y, z, t):
	return (x * x) - ((y * 4.0) * ((z * z) - t))
function code(x, y, z, t)
	return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t)))
end
function tmp = code(x, y, z, t)
	tmp = (x * x) - ((y * 4.0) * ((z * z) - t));
end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\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 9 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: 89.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
double code(double x, double y, double z, double t) {
	return (x * x) - ((y * 4.0) * ((z * z) - t));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * x) - ((y * 4.0d0) * ((z * z) - t))
end function
public static double code(double x, double y, double z, double t) {
	return (x * x) - ((y * 4.0) * ((z * z) - t));
}
def code(x, y, z, t):
	return (x * x) - ((y * 4.0) * ((z * z) - t))
function code(x, y, z, t)
	return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t)))
end
function tmp = code(x, y, z, t)
	tmp = (x * x) - ((y * 4.0) * ((z * z) - t));
end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\end{array}

Alternative 1: 95.4% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{y \cdot -4}\\ \mathbf{if}\;y \cdot 4 \leq -2 \cdot 10^{-297}:\\ \;\;\;\;x \cdot x - \mathsf{fma}\left(t, y \cdot -4, z \cdot \left(\left(-t_1\right) \cdot \left(z \cdot t_1\right)\right)\right)\\ \mathbf{elif}\;y \cdot 4 \leq 5 \cdot 10^{-154}:\\ \;\;\;\;x \cdot x - \left(-4 \cdot \left(y \cdot t\right) + 4 \cdot {\left(z \cdot \sqrt{y}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \mathsf{fma}\left(z, -z, t\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (sqrt (* y -4.0))))
   (if (<= (* y 4.0) -2e-297)
     (- (* x x) (fma t (* y -4.0) (* z (* (- t_1) (* z t_1)))))
     (if (<= (* y 4.0) 5e-154)
       (- (* x x) (+ (* -4.0 (* y t)) (* 4.0 (pow (* z (sqrt y)) 2.0))))
       (fma x x (* 4.0 (* y (fma z (- z) t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((y * -4.0));
	double tmp;
	if ((y * 4.0) <= -2e-297) {
		tmp = (x * x) - fma(t, (y * -4.0), (z * (-t_1 * (z * t_1))));
	} else if ((y * 4.0) <= 5e-154) {
		tmp = (x * x) - ((-4.0 * (y * t)) + (4.0 * pow((z * sqrt(y)), 2.0)));
	} else {
		tmp = fma(x, x, (4.0 * (y * fma(z, -z, t))));
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = sqrt(Float64(y * -4.0))
	tmp = 0.0
	if (Float64(y * 4.0) <= -2e-297)
		tmp = Float64(Float64(x * x) - fma(t, Float64(y * -4.0), Float64(z * Float64(Float64(-t_1) * Float64(z * t_1)))));
	elseif (Float64(y * 4.0) <= 5e-154)
		tmp = Float64(Float64(x * x) - Float64(Float64(-4.0 * Float64(y * t)) + Float64(4.0 * (Float64(z * sqrt(y)) ^ 2.0))));
	else
		tmp = fma(x, x, Float64(4.0 * Float64(y * fma(z, Float64(-z), t))));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y * -4.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(y * 4.0), $MachinePrecision], -2e-297], N[(N[(x * x), $MachinePrecision] - N[(t * N[(y * -4.0), $MachinePrecision] + N[(z * N[((-t$95$1) * N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y * 4.0), $MachinePrecision], 5e-154], N[(N[(x * x), $MachinePrecision] - N[(N[(-4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[Power[N[(z * N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(4.0 * N[(y * N[(z * (-z) + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{y \cdot -4}\\
\mathbf{if}\;y \cdot 4 \leq -2 \cdot 10^{-297}:\\
\;\;\;\;x \cdot x - \mathsf{fma}\left(t, y \cdot -4, z \cdot \left(\left(-t_1\right) \cdot \left(z \cdot t_1\right)\right)\right)\\

\mathbf{elif}\;y \cdot 4 \leq 5 \cdot 10^{-154}:\\
\;\;\;\;x \cdot x - \left(-4 \cdot \left(y \cdot t\right) + 4 \cdot {\left(z \cdot \sqrt{y}\right)}^{2}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 y 4) < -2.00000000000000008e-297

    1. Initial program 92.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around 0 87.9%

      \[\leadsto x \cdot x - \color{blue}{\left(-4 \cdot \left(t \cdot y\right) + 4 \cdot \left(y \cdot {z}^{2}\right)\right)} \]
    3. Step-by-step derivation
      1. add-sqr-sqrt30.1%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \color{blue}{\sqrt{4 \cdot \left(y \cdot {z}^{2}\right)} \cdot \sqrt{4 \cdot \left(y \cdot {z}^{2}\right)}}\right) \]
      2. sqrt-unprod60.2%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \color{blue}{\sqrt{\left(4 \cdot \left(y \cdot {z}^{2}\right)\right) \cdot \left(4 \cdot \left(y \cdot {z}^{2}\right)\right)}}\right) \]
      3. swap-sqr60.2%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \sqrt{\color{blue}{\left(4 \cdot 4\right) \cdot \left(\left(y \cdot {z}^{2}\right) \cdot \left(y \cdot {z}^{2}\right)\right)}}\right) \]
      4. metadata-eval60.2%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \sqrt{\color{blue}{16} \cdot \left(\left(y \cdot {z}^{2}\right) \cdot \left(y \cdot {z}^{2}\right)\right)}\right) \]
      5. metadata-eval60.2%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \sqrt{\color{blue}{\left(-4 \cdot -4\right)} \cdot \left(\left(y \cdot {z}^{2}\right) \cdot \left(y \cdot {z}^{2}\right)\right)}\right) \]
      6. swap-sqr60.2%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \sqrt{\color{blue}{\left(-4 \cdot \left(y \cdot {z}^{2}\right)\right) \cdot \left(-4 \cdot \left(y \cdot {z}^{2}\right)\right)}}\right) \]
      7. associate-*l*60.2%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \sqrt{\color{blue}{\left(\left(-4 \cdot y\right) \cdot {z}^{2}\right)} \cdot \left(-4 \cdot \left(y \cdot {z}^{2}\right)\right)}\right) \]
      8. associate-*l*60.2%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \sqrt{\left(\left(-4 \cdot y\right) \cdot {z}^{2}\right) \cdot \color{blue}{\left(\left(-4 \cdot y\right) \cdot {z}^{2}\right)}}\right) \]
      9. sqrt-unprod61.1%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \color{blue}{\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}} \cdot \sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}}\right) \]
      10. add-sqr-sqrt61.1%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}}\right) \]
      11. associate-*l*61.1%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)}\right) \]
      12. metadata-eval61.1%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + \color{blue}{\left(-4\right)} \cdot \left(y \cdot {z}^{2}\right)\right) \]
      13. cancel-sign-sub-inv61.1%

        \[\leadsto x \cdot x - \color{blue}{\left(-4 \cdot \left(t \cdot y\right) - 4 \cdot \left(y \cdot {z}^{2}\right)\right)} \]
      14. add-sqr-sqrt29.1%

        \[\leadsto x \cdot x - \left(\color{blue}{\sqrt{-4 \cdot \left(t \cdot y\right)} \cdot \sqrt{-4 \cdot \left(t \cdot y\right)}} - 4 \cdot \left(y \cdot {z}^{2}\right)\right) \]
      15. add-sqr-sqrt12.3%

        \[\leadsto x \cdot x - \left(\sqrt{-4 \cdot \left(t \cdot y\right)} \cdot \sqrt{-4 \cdot \left(t \cdot y\right)} - \color{blue}{\sqrt{4 \cdot \left(y \cdot {z}^{2}\right)} \cdot \sqrt{4 \cdot \left(y \cdot {z}^{2}\right)}}\right) \]
      16. difference-of-squares12.3%

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{-4 \cdot \left(t \cdot y\right)} + \sqrt{4 \cdot \left(y \cdot {z}^{2}\right)}\right) \cdot \left(\sqrt{-4 \cdot \left(t \cdot y\right)} - \sqrt{4 \cdot \left(y \cdot {z}^{2}\right)}\right)} \]
    4. Applied egg-rr49.3%

      \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{y \cdot \left(-4 \cdot t\right)} + z \cdot \sqrt{y \cdot -4}\right) \cdot \left(\sqrt{y \cdot \left(-4 \cdot t\right)} - z \cdot \sqrt{y \cdot -4}\right)} \]
    5. Step-by-step derivation
      1. +-commutative49.3%

        \[\leadsto x \cdot x - \color{blue}{\left(z \cdot \sqrt{y \cdot -4} + \sqrt{y \cdot \left(-4 \cdot t\right)}\right)} \cdot \left(\sqrt{y \cdot \left(-4 \cdot t\right)} - z \cdot \sqrt{y \cdot -4}\right) \]
      2. *-commutative49.3%

        \[\leadsto x \cdot x - \left(z \cdot \sqrt{\color{blue}{-4 \cdot y}} + \sqrt{y \cdot \left(-4 \cdot t\right)}\right) \cdot \left(\sqrt{y \cdot \left(-4 \cdot t\right)} - z \cdot \sqrt{y \cdot -4}\right) \]
      3. *-commutative49.3%

        \[\leadsto x \cdot x - \left(z \cdot \sqrt{-4 \cdot y} + \sqrt{\color{blue}{\left(-4 \cdot t\right) \cdot y}}\right) \cdot \left(\sqrt{y \cdot \left(-4 \cdot t\right)} - z \cdot \sqrt{y \cdot -4}\right) \]
      4. associate-*r*49.3%

        \[\leadsto x \cdot x - \left(z \cdot \sqrt{-4 \cdot y} + \sqrt{\color{blue}{-4 \cdot \left(t \cdot y\right)}}\right) \cdot \left(\sqrt{y \cdot \left(-4 \cdot t\right)} - z \cdot \sqrt{y \cdot -4}\right) \]
      5. *-commutative49.3%

        \[\leadsto x \cdot x - \left(z \cdot \sqrt{-4 \cdot y} + \sqrt{-4 \cdot \left(t \cdot y\right)}\right) \cdot \left(\sqrt{\color{blue}{\left(-4 \cdot t\right) \cdot y}} - z \cdot \sqrt{y \cdot -4}\right) \]
      6. associate-*r*49.3%

        \[\leadsto x \cdot x - \left(z \cdot \sqrt{-4 \cdot y} + \sqrt{-4 \cdot \left(t \cdot y\right)}\right) \cdot \left(\sqrt{\color{blue}{-4 \cdot \left(t \cdot y\right)}} - z \cdot \sqrt{y \cdot -4}\right) \]
      7. *-commutative49.3%

        \[\leadsto x \cdot x - \left(z \cdot \sqrt{-4 \cdot y} + \sqrt{-4 \cdot \left(t \cdot y\right)}\right) \cdot \left(\sqrt{-4 \cdot \left(t \cdot y\right)} - z \cdot \sqrt{\color{blue}{-4 \cdot y}}\right) \]
    6. Simplified49.3%

      \[\leadsto x \cdot x - \color{blue}{\left(z \cdot \sqrt{-4 \cdot y} + \sqrt{-4 \cdot \left(t \cdot y\right)}\right) \cdot \left(\sqrt{-4 \cdot \left(t \cdot y\right)} - z \cdot \sqrt{-4 \cdot y}\right)} \]
    7. Step-by-step derivation
      1. +-commutative49.3%

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{-4 \cdot \left(t \cdot y\right)} + z \cdot \sqrt{-4 \cdot y}\right)} \cdot \left(\sqrt{-4 \cdot \left(t \cdot y\right)} - z \cdot \sqrt{-4 \cdot y}\right) \]
      2. difference-of-squares49.3%

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{-4 \cdot \left(t \cdot y\right)} \cdot \sqrt{-4 \cdot \left(t \cdot y\right)} - \left(z \cdot \sqrt{-4 \cdot y}\right) \cdot \left(z \cdot \sqrt{-4 \cdot y}\right)\right)} \]
      3. cancel-sign-sub-inv49.3%

        \[\leadsto x \cdot x - \color{blue}{\left(\sqrt{-4 \cdot \left(t \cdot y\right)} \cdot \sqrt{-4 \cdot \left(t \cdot y\right)} + \left(-z \cdot \sqrt{-4 \cdot y}\right) \cdot \left(z \cdot \sqrt{-4 \cdot y}\right)\right)} \]
      4. add-sqr-sqrt93.6%

        \[\leadsto x \cdot x - \left(\color{blue}{-4 \cdot \left(t \cdot y\right)} + \left(-z \cdot \sqrt{-4 \cdot y}\right) \cdot \left(z \cdot \sqrt{-4 \cdot y}\right)\right) \]
      5. *-commutative93.6%

        \[\leadsto x \cdot x - \left(\color{blue}{\left(t \cdot y\right) \cdot -4} + \left(-z \cdot \sqrt{-4 \cdot y}\right) \cdot \left(z \cdot \sqrt{-4 \cdot y}\right)\right) \]
      6. associate-*l*93.6%

        \[\leadsto x \cdot x - \left(\color{blue}{t \cdot \left(y \cdot -4\right)} + \left(-z \cdot \sqrt{-4 \cdot y}\right) \cdot \left(z \cdot \sqrt{-4 \cdot y}\right)\right) \]
      7. *-commutative93.6%

        \[\leadsto x \cdot x - \left(t \cdot \left(y \cdot -4\right) + \left(-z \cdot \sqrt{\color{blue}{y \cdot -4}}\right) \cdot \left(z \cdot \sqrt{-4 \cdot y}\right)\right) \]
      8. distribute-rgt-neg-in93.6%

        \[\leadsto x \cdot x - \left(t \cdot \left(y \cdot -4\right) + \color{blue}{\left(z \cdot \left(-\sqrt{y \cdot -4}\right)\right)} \cdot \left(z \cdot \sqrt{-4 \cdot y}\right)\right) \]
      9. *-commutative93.6%

        \[\leadsto x \cdot x - \left(t \cdot \left(y \cdot -4\right) + \left(z \cdot \left(-\sqrt{y \cdot -4}\right)\right) \cdot \left(z \cdot \sqrt{\color{blue}{y \cdot -4}}\right)\right) \]
    8. Applied egg-rr93.6%

      \[\leadsto x \cdot x - \color{blue}{\left(t \cdot \left(y \cdot -4\right) + \left(z \cdot \left(-\sqrt{y \cdot -4}\right)\right) \cdot \left(z \cdot \sqrt{y \cdot -4}\right)\right)} \]
    9. Step-by-step derivation
      1. fma-def98.1%

        \[\leadsto x \cdot x - \color{blue}{\mathsf{fma}\left(t, y \cdot -4, \left(z \cdot \left(-\sqrt{y \cdot -4}\right)\right) \cdot \left(z \cdot \sqrt{y \cdot -4}\right)\right)} \]
      2. *-commutative98.1%

        \[\leadsto x \cdot x - \mathsf{fma}\left(t, \color{blue}{-4 \cdot y}, \left(z \cdot \left(-\sqrt{y \cdot -4}\right)\right) \cdot \left(z \cdot \sqrt{y \cdot -4}\right)\right) \]
      3. associate-*l*98.1%

        \[\leadsto x \cdot x - \mathsf{fma}\left(t, -4 \cdot y, \color{blue}{z \cdot \left(\left(-\sqrt{y \cdot -4}\right) \cdot \left(z \cdot \sqrt{y \cdot -4}\right)\right)}\right) \]
      4. *-commutative98.1%

        \[\leadsto x \cdot x - \mathsf{fma}\left(t, -4 \cdot y, z \cdot \left(\left(-\sqrt{\color{blue}{-4 \cdot y}}\right) \cdot \left(z \cdot \sqrt{y \cdot -4}\right)\right)\right) \]
      5. *-commutative98.1%

        \[\leadsto x \cdot x - \mathsf{fma}\left(t, -4 \cdot y, z \cdot \left(\left(-\sqrt{-4 \cdot y}\right) \cdot \left(z \cdot \sqrt{\color{blue}{-4 \cdot y}}\right)\right)\right) \]
    10. Simplified98.1%

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

    if -2.00000000000000008e-297 < (*.f64 y 4) < 5.0000000000000002e-154

    1. Initial program 79.8%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around 0 79.8%

      \[\leadsto x \cdot x - \color{blue}{\left(-4 \cdot \left(t \cdot y\right) + 4 \cdot \left(y \cdot {z}^{2}\right)\right)} \]
    3. Step-by-step derivation
      1. add-sqr-sqrt79.8%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + 4 \cdot \color{blue}{\left(\sqrt{y \cdot {z}^{2}} \cdot \sqrt{y \cdot {z}^{2}}\right)}\right) \]
      2. pow279.8%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + 4 \cdot \color{blue}{{\left(\sqrt{y \cdot {z}^{2}}\right)}^{2}}\right) \]
      3. *-commutative79.8%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + 4 \cdot {\left(\sqrt{\color{blue}{{z}^{2} \cdot y}}\right)}^{2}\right) \]
      4. sqrt-prod79.8%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + 4 \cdot {\color{blue}{\left(\sqrt{{z}^{2}} \cdot \sqrt{y}\right)}}^{2}\right) \]
      5. unpow279.8%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + 4 \cdot {\left(\sqrt{\color{blue}{z \cdot z}} \cdot \sqrt{y}\right)}^{2}\right) \]
      6. sqrt-prod39.3%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + 4 \cdot {\left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \sqrt{y}\right)}^{2}\right) \]
      7. add-sqr-sqrt99.9%

        \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + 4 \cdot {\left(\color{blue}{z} \cdot \sqrt{y}\right)}^{2}\right) \]
    4. Applied egg-rr99.9%

      \[\leadsto x \cdot x - \left(-4 \cdot \left(t \cdot y\right) + 4 \cdot \color{blue}{{\left(z \cdot \sqrt{y}\right)}^{2}}\right) \]

    if 5.0000000000000002e-154 < (*.f64 y 4)

    1. Initial program 86.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg95.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, -\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)} \]
      2. distribute-rgt-neg-in95.2%

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(y \cdot 4\right) \cdot \left(-\left(z \cdot z - t\right)\right)}\right) \]
      3. *-commutative95.2%

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(4 \cdot y\right)} \cdot \left(-\left(z \cdot z - t\right)\right)\right) \]
      4. associate-*l*96.1%

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{4 \cdot \left(y \cdot \left(-\left(z \cdot z - t\right)\right)\right)}\right) \]
      5. sub-neg96.1%

        \[\leadsto \mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \left(-\color{blue}{\left(z \cdot z + \left(-t\right)\right)}\right)\right)\right) \]
      6. distribute-neg-in96.1%

        \[\leadsto \mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \color{blue}{\left(\left(-z \cdot z\right) + \left(-\left(-t\right)\right)\right)}\right)\right) \]
      7. distribute-rgt-neg-out96.1%

        \[\leadsto \mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \left(\color{blue}{z \cdot \left(-z\right)} + \left(-\left(-t\right)\right)\right)\right)\right) \]
      8. remove-double-neg96.1%

        \[\leadsto \mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \left(z \cdot \left(-z\right) + \color{blue}{t}\right)\right)\right) \]
      9. fma-def96.1%

        \[\leadsto \mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(z, -z, t\right)}\right)\right) \]
    3. Simplified96.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot 4 \leq -2 \cdot 10^{-297}:\\ \;\;\;\;x \cdot x - \mathsf{fma}\left(t, y \cdot -4, z \cdot \left(\left(-\sqrt{y \cdot -4}\right) \cdot \left(z \cdot \sqrt{y \cdot -4}\right)\right)\right)\\ \mathbf{elif}\;y \cdot 4 \leq 5 \cdot 10^{-154}:\\ \;\;\;\;x \cdot x - \left(-4 \cdot \left(y \cdot t\right) + 4 \cdot {\left(z \cdot \sqrt{y}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \mathsf{fma}\left(z, -z, t\right)\right)\right)\\ \end{array} \]

Alternative 2: 96.1% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\ \;\;\;\;\mathsf{fma}\left(y, -4 \cdot \left({z}^{2} - t\right), {x}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 2e+293)
   (fma y (* -4.0 (- (pow z 2.0) t)) (pow x 2.0))
   (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 2e+293) {
		tmp = fma(y, (-4.0 * (pow(z, 2.0) - t)), pow(x, 2.0));
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * z) <= 2e+293)
		tmp = fma(y, Float64(-4.0 * Float64((z ^ 2.0) - t)), (x ^ 2.0));
	else
		tmp = Float64(z * Float64(z * Float64(y * -4.0)));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+293], N[(y * N[(-4.0 * N[(N[Power[z, 2.0], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\
\;\;\;\;\mathsf{fma}\left(y, -4 \cdot \left({z}^{2} - t\right), {x}^{2}\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 1.9999999999999998e293

    1. Initial program 95.1%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around 0 95.1%

      \[\leadsto x \cdot x - \color{blue}{\left(-4 \cdot \left(t \cdot y\right) + 4 \cdot \left(y \cdot {z}^{2}\right)\right)} \]
    3. Taylor expanded in x around 0 95.1%

      \[\leadsto \color{blue}{-1 \cdot \left(-4 \cdot \left(t \cdot y\right) + 4 \cdot \left(y \cdot {z}^{2}\right)\right) + {x}^{2}} \]
    4. Step-by-step derivation
      1. mul-1-neg95.1%

        \[\leadsto \color{blue}{\left(-\left(-4 \cdot \left(t \cdot y\right) + 4 \cdot \left(y \cdot {z}^{2}\right)\right)\right)} + {x}^{2} \]
      2. associate-*r*95.1%

        \[\leadsto \left(-\left(\color{blue}{\left(-4 \cdot t\right) \cdot y} + 4 \cdot \left(y \cdot {z}^{2}\right)\right)\right) + {x}^{2} \]
      3. *-commutative95.1%

        \[\leadsto \left(-\left(\color{blue}{y \cdot \left(-4 \cdot t\right)} + 4 \cdot \left(y \cdot {z}^{2}\right)\right)\right) + {x}^{2} \]
      4. distribute-neg-in95.1%

        \[\leadsto \color{blue}{\left(\left(-y \cdot \left(-4 \cdot t\right)\right) + \left(-4 \cdot \left(y \cdot {z}^{2}\right)\right)\right)} + {x}^{2} \]
      5. distribute-lft-neg-in95.1%

        \[\leadsto \left(\left(-y \cdot \left(-4 \cdot t\right)\right) + \color{blue}{\left(-4\right) \cdot \left(y \cdot {z}^{2}\right)}\right) + {x}^{2} \]
      6. metadata-eval95.1%

        \[\leadsto \left(\left(-y \cdot \left(-4 \cdot t\right)\right) + \color{blue}{-4} \cdot \left(y \cdot {z}^{2}\right)\right) + {x}^{2} \]
      7. associate-*r*94.5%

        \[\leadsto \left(\left(-y \cdot \left(-4 \cdot t\right)\right) + \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}}\right) + {x}^{2} \]
      8. *-commutative94.5%

        \[\leadsto \left(\left(-y \cdot \left(-4 \cdot t\right)\right) + \color{blue}{\left(y \cdot -4\right)} \cdot {z}^{2}\right) + {x}^{2} \]
      9. associate-*r*95.1%

        \[\leadsto \left(\left(-y \cdot \left(-4 \cdot t\right)\right) + \color{blue}{y \cdot \left(-4 \cdot {z}^{2}\right)}\right) + {x}^{2} \]
      10. +-commutative95.1%

        \[\leadsto \color{blue}{\left(y \cdot \left(-4 \cdot {z}^{2}\right) + \left(-y \cdot \left(-4 \cdot t\right)\right)\right)} + {x}^{2} \]
      11. sub-neg95.1%

        \[\leadsto \color{blue}{\left(y \cdot \left(-4 \cdot {z}^{2}\right) - y \cdot \left(-4 \cdot t\right)\right)} + {x}^{2} \]
      12. distribute-lft-out--95.6%

        \[\leadsto \color{blue}{y \cdot \left(-4 \cdot {z}^{2} - -4 \cdot t\right)} + {x}^{2} \]
      13. cancel-sign-sub-inv95.6%

        \[\leadsto y \cdot \color{blue}{\left(-4 \cdot {z}^{2} + \left(--4\right) \cdot t\right)} + {x}^{2} \]
      14. metadata-eval95.6%

        \[\leadsto y \cdot \left(-4 \cdot {z}^{2} + \color{blue}{4} \cdot t\right) + {x}^{2} \]
      15. fma-def97.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, -4 \cdot {z}^{2} + 4 \cdot t, {x}^{2}\right)} \]
    5. Simplified97.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, -4 \cdot \left({z}^{2} - t\right), {x}^{2}\right)} \]

    if 1.9999999999999998e293 < (*.f64 z z)

    1. Initial program 69.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around inf 76.8%

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*76.8%

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    4. Simplified76.8%

      \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt30.7%

        \[\leadsto \color{blue}{\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}} \cdot \sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}} \]
      2. pow230.7%

        \[\leadsto \color{blue}{{\left(\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}\right)}^{2}} \]
      3. *-commutative30.7%

        \[\leadsto {\left(\sqrt{\color{blue}{{z}^{2} \cdot \left(-4 \cdot y\right)}}\right)}^{2} \]
      4. sqrt-prod30.7%

        \[\leadsto {\color{blue}{\left(\sqrt{{z}^{2}} \cdot \sqrt{-4 \cdot y}\right)}}^{2} \]
      5. unpow230.7%

        \[\leadsto {\left(\sqrt{\color{blue}{z \cdot z}} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      6. sqrt-prod22.9%

        \[\leadsto {\left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      7. add-sqr-sqrt37.2%

        \[\leadsto {\left(\color{blue}{z} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      8. *-commutative37.2%

        \[\leadsto {\left(z \cdot \sqrt{\color{blue}{y \cdot -4}}\right)}^{2} \]
    6. Applied egg-rr37.2%

      \[\leadsto \color{blue}{{\left(z \cdot \sqrt{y \cdot -4}\right)}^{2}} \]
    7. Step-by-step derivation
      1. unpow-prod-down30.7%

        \[\leadsto \color{blue}{{z}^{2} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}} \]
      2. unpow230.7%

        \[\leadsto \color{blue}{\left(z \cdot z\right)} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2} \]
      3. associate-*l*37.3%

        \[\leadsto \color{blue}{z \cdot \left(z \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}\right)} \]
      4. unpow237.3%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)}\right) \]
      5. add-sqr-sqrt90.1%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(y \cdot -4\right)}\right) \]
    8. Applied egg-rr90.1%

      \[\leadsto \color{blue}{z \cdot \left(z \cdot \left(y \cdot -4\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\ \;\;\;\;\mathsf{fma}\left(y, -4 \cdot \left({z}^{2} - t\right), {x}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \]

Alternative 3: 95.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\ \;\;\;\;\mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \mathsf{fma}\left(z, -z, t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 2e+293)
   (fma x x (* 4.0 (* y (fma z (- z) t))))
   (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 2e+293) {
		tmp = fma(x, x, (4.0 * (y * fma(z, -z, t))));
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * z) <= 2e+293)
		tmp = fma(x, x, Float64(4.0 * Float64(y * fma(z, Float64(-z), t))));
	else
		tmp = Float64(z * Float64(z * Float64(y * -4.0)));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+293], N[(x * x + N[(4.0 * N[(y * N[(z * (-z) + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\
\;\;\;\;\mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \mathsf{fma}\left(z, -z, t\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 1.9999999999999998e293

    1. Initial program 95.1%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg97.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, -\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)} \]
      2. distribute-rgt-neg-in97.3%

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(y \cdot 4\right) \cdot \left(-\left(z \cdot z - t\right)\right)}\right) \]
      3. *-commutative97.3%

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(4 \cdot y\right)} \cdot \left(-\left(z \cdot z - t\right)\right)\right) \]
      4. associate-*l*97.8%

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{4 \cdot \left(y \cdot \left(-\left(z \cdot z - t\right)\right)\right)}\right) \]
      5. sub-neg97.8%

        \[\leadsto \mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \left(-\color{blue}{\left(z \cdot z + \left(-t\right)\right)}\right)\right)\right) \]
      6. distribute-neg-in97.8%

        \[\leadsto \mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \color{blue}{\left(\left(-z \cdot z\right) + \left(-\left(-t\right)\right)\right)}\right)\right) \]
      7. distribute-rgt-neg-out97.8%

        \[\leadsto \mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \left(\color{blue}{z \cdot \left(-z\right)} + \left(-\left(-t\right)\right)\right)\right)\right) \]
      8. remove-double-neg97.8%

        \[\leadsto \mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \left(z \cdot \left(-z\right) + \color{blue}{t}\right)\right)\right) \]
      9. fma-def97.8%

        \[\leadsto \mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(z, -z, t\right)}\right)\right) \]
    3. Simplified97.8%

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

    if 1.9999999999999998e293 < (*.f64 z z)

    1. Initial program 69.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around inf 76.8%

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*76.8%

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    4. Simplified76.8%

      \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt30.7%

        \[\leadsto \color{blue}{\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}} \cdot \sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}} \]
      2. pow230.7%

        \[\leadsto \color{blue}{{\left(\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}\right)}^{2}} \]
      3. *-commutative30.7%

        \[\leadsto {\left(\sqrt{\color{blue}{{z}^{2} \cdot \left(-4 \cdot y\right)}}\right)}^{2} \]
      4. sqrt-prod30.7%

        \[\leadsto {\color{blue}{\left(\sqrt{{z}^{2}} \cdot \sqrt{-4 \cdot y}\right)}}^{2} \]
      5. unpow230.7%

        \[\leadsto {\left(\sqrt{\color{blue}{z \cdot z}} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      6. sqrt-prod22.9%

        \[\leadsto {\left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      7. add-sqr-sqrt37.2%

        \[\leadsto {\left(\color{blue}{z} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      8. *-commutative37.2%

        \[\leadsto {\left(z \cdot \sqrt{\color{blue}{y \cdot -4}}\right)}^{2} \]
    6. Applied egg-rr37.2%

      \[\leadsto \color{blue}{{\left(z \cdot \sqrt{y \cdot -4}\right)}^{2}} \]
    7. Step-by-step derivation
      1. unpow-prod-down30.7%

        \[\leadsto \color{blue}{{z}^{2} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}} \]
      2. unpow230.7%

        \[\leadsto \color{blue}{\left(z \cdot z\right)} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2} \]
      3. associate-*l*37.3%

        \[\leadsto \color{blue}{z \cdot \left(z \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}\right)} \]
      4. unpow237.3%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)}\right) \]
      5. add-sqr-sqrt90.1%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(y \cdot -4\right)}\right) \]
    8. Applied egg-rr90.1%

      \[\leadsto \color{blue}{z \cdot \left(z \cdot \left(y \cdot -4\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\ \;\;\;\;\mathsf{fma}\left(x, x, 4 \cdot \left(y \cdot \mathsf{fma}\left(z, -z, t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \]

Alternative 4: 95.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 2e+293)
   (fma x x (* (* y -4.0) (- (* z z) t)))
   (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 2e+293) {
		tmp = fma(x, x, ((y * -4.0) * ((z * z) - t)));
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * z) <= 2e+293)
		tmp = fma(x, x, Float64(Float64(y * -4.0) * Float64(Float64(z * z) - t)));
	else
		tmp = Float64(z * Float64(z * Float64(y * -4.0)));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+293], N[(x * x + N[(N[(y * -4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 1.9999999999999998e293

    1. Initial program 95.1%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. fma-neg97.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, -\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)} \]
      2. *-commutative97.3%

        \[\leadsto \mathsf{fma}\left(x, x, -\color{blue}{\left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)}\right) \]
      3. distribute-rgt-neg-in97.3%

        \[\leadsto \mathsf{fma}\left(x, x, \color{blue}{\left(z \cdot z - t\right) \cdot \left(-y \cdot 4\right)}\right) \]
      4. distribute-lft-neg-out97.3%

        \[\leadsto \mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \color{blue}{\left(\left(-y\right) \cdot 4\right)}\right) \]
      5. distribute-lft-neg-out97.3%

        \[\leadsto \mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \color{blue}{\left(-y \cdot 4\right)}\right) \]
      6. distribute-rgt-neg-in97.3%

        \[\leadsto \mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \color{blue}{\left(y \cdot \left(-4\right)\right)}\right) \]
      7. metadata-eval97.3%

        \[\leadsto \mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot \color{blue}{-4}\right)\right) \]
    3. Simplified97.3%

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

    if 1.9999999999999998e293 < (*.f64 z z)

    1. Initial program 69.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around inf 76.8%

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*76.8%

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    4. Simplified76.8%

      \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt30.7%

        \[\leadsto \color{blue}{\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}} \cdot \sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}} \]
      2. pow230.7%

        \[\leadsto \color{blue}{{\left(\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}\right)}^{2}} \]
      3. *-commutative30.7%

        \[\leadsto {\left(\sqrt{\color{blue}{{z}^{2} \cdot \left(-4 \cdot y\right)}}\right)}^{2} \]
      4. sqrt-prod30.7%

        \[\leadsto {\color{blue}{\left(\sqrt{{z}^{2}} \cdot \sqrt{-4 \cdot y}\right)}}^{2} \]
      5. unpow230.7%

        \[\leadsto {\left(\sqrt{\color{blue}{z \cdot z}} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      6. sqrt-prod22.9%

        \[\leadsto {\left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      7. add-sqr-sqrt37.2%

        \[\leadsto {\left(\color{blue}{z} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      8. *-commutative37.2%

        \[\leadsto {\left(z \cdot \sqrt{\color{blue}{y \cdot -4}}\right)}^{2} \]
    6. Applied egg-rr37.2%

      \[\leadsto \color{blue}{{\left(z \cdot \sqrt{y \cdot -4}\right)}^{2}} \]
    7. Step-by-step derivation
      1. unpow-prod-down30.7%

        \[\leadsto \color{blue}{{z}^{2} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}} \]
      2. unpow230.7%

        \[\leadsto \color{blue}{\left(z \cdot z\right)} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2} \]
      3. associate-*l*37.3%

        \[\leadsto \color{blue}{z \cdot \left(z \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}\right)} \]
      4. unpow237.3%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)}\right) \]
      5. add-sqr-sqrt90.1%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(y \cdot -4\right)}\right) \]
    8. Applied egg-rr90.1%

      \[\leadsto \color{blue}{z \cdot \left(z \cdot \left(y \cdot -4\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(y \cdot -4\right) \cdot \left(z \cdot z - t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \]

Alternative 5: 94.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\ \;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 2e+293)
   (+ (* x x) (* (* y 4.0) (- t (* z z))))
   (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 2e+293) {
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z * z) <= 2d+293) then
        tmp = (x * x) + ((y * 4.0d0) * (t - (z * z)))
    else
        tmp = z * (z * (y * (-4.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 2e+293) {
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z * z) <= 2e+293:
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)))
	else:
		tmp = z * (z * (y * -4.0))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * z) <= 2e+293)
		tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z))));
	else
		tmp = Float64(z * Float64(z * Float64(y * -4.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z * z) <= 2e+293)
		tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
	else
		tmp = z * (z * (y * -4.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+293], N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z z) < 1.9999999999999998e293

    1. Initial program 95.1%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]

    if 1.9999999999999998e293 < (*.f64 z z)

    1. Initial program 69.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around inf 76.8%

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*76.8%

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    4. Simplified76.8%

      \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt30.7%

        \[\leadsto \color{blue}{\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}} \cdot \sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}} \]
      2. pow230.7%

        \[\leadsto \color{blue}{{\left(\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}\right)}^{2}} \]
      3. *-commutative30.7%

        \[\leadsto {\left(\sqrt{\color{blue}{{z}^{2} \cdot \left(-4 \cdot y\right)}}\right)}^{2} \]
      4. sqrt-prod30.7%

        \[\leadsto {\color{blue}{\left(\sqrt{{z}^{2}} \cdot \sqrt{-4 \cdot y}\right)}}^{2} \]
      5. unpow230.7%

        \[\leadsto {\left(\sqrt{\color{blue}{z \cdot z}} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      6. sqrt-prod22.9%

        \[\leadsto {\left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      7. add-sqr-sqrt37.2%

        \[\leadsto {\left(\color{blue}{z} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      8. *-commutative37.2%

        \[\leadsto {\left(z \cdot \sqrt{\color{blue}{y \cdot -4}}\right)}^{2} \]
    6. Applied egg-rr37.2%

      \[\leadsto \color{blue}{{\left(z \cdot \sqrt{y \cdot -4}\right)}^{2}} \]
    7. Step-by-step derivation
      1. unpow-prod-down30.7%

        \[\leadsto \color{blue}{{z}^{2} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}} \]
      2. unpow230.7%

        \[\leadsto \color{blue}{\left(z \cdot z\right)} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2} \]
      3. associate-*l*37.3%

        \[\leadsto \color{blue}{z \cdot \left(z \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}\right)} \]
      4. unpow237.3%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)}\right) \]
      5. add-sqr-sqrt90.1%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(y \cdot -4\right)}\right) \]
    8. Applied egg-rr90.1%

      \[\leadsto \color{blue}{z \cdot \left(z \cdot \left(y \cdot -4\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+293}:\\ \;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \]

Alternative 6: 75.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 7.2 \cdot 10^{+90}:\\ \;\;\;\;x \cdot x - y \cdot \left(t \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z 7.2e+90) (- (* x x) (* y (* t -4.0))) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 7.2e+90) {
		tmp = (x * x) - (y * (t * -4.0));
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= 7.2d+90) then
        tmp = (x * x) - (y * (t * (-4.0d0)))
    else
        tmp = z * (z * (y * (-4.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 7.2e+90) {
		tmp = (x * x) - (y * (t * -4.0));
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= 7.2e+90:
		tmp = (x * x) - (y * (t * -4.0))
	else:
		tmp = z * (z * (y * -4.0))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= 7.2e+90)
		tmp = Float64(Float64(x * x) - Float64(y * Float64(t * -4.0)));
	else
		tmp = Float64(z * Float64(z * Float64(y * -4.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= 7.2e+90)
		tmp = (x * x) - (y * (t * -4.0));
	else
		tmp = z * (z * (y * -4.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, 7.2e+90], N[(N[(x * x), $MachinePrecision] - N[(y * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.2 \cdot 10^{+90}:\\
\;\;\;\;x \cdot x - y \cdot \left(t \cdot -4\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 7.2e90

    1. Initial program 91.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around 0 76.8%

      \[\leadsto x \cdot x - \color{blue}{-4 \cdot \left(t \cdot y\right)} \]
    3. Step-by-step derivation
      1. *-commutative76.8%

        \[\leadsto x \cdot x - \color{blue}{\left(t \cdot y\right) \cdot -4} \]
      2. *-commutative76.8%

        \[\leadsto x \cdot x - \color{blue}{\left(y \cdot t\right)} \cdot -4 \]
      3. associate-*l*76.8%

        \[\leadsto x \cdot x - \color{blue}{y \cdot \left(t \cdot -4\right)} \]
    4. Simplified76.8%

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

    if 7.2e90 < z

    1. Initial program 75.4%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around inf 75.9%

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*75.9%

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    4. Simplified75.9%

      \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt28.0%

        \[\leadsto \color{blue}{\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}} \cdot \sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}} \]
      2. pow228.0%

        \[\leadsto \color{blue}{{\left(\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}\right)}^{2}} \]
      3. *-commutative28.0%

        \[\leadsto {\left(\sqrt{\color{blue}{{z}^{2} \cdot \left(-4 \cdot y\right)}}\right)}^{2} \]
      4. sqrt-prod28.0%

        \[\leadsto {\color{blue}{\left(\sqrt{{z}^{2}} \cdot \sqrt{-4 \cdot y}\right)}}^{2} \]
      5. unpow228.0%

        \[\leadsto {\left(\sqrt{\color{blue}{z \cdot z}} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      6. sqrt-prod33.4%

        \[\leadsto {\left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      7. add-sqr-sqrt33.4%

        \[\leadsto {\left(\color{blue}{z} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      8. *-commutative33.4%

        \[\leadsto {\left(z \cdot \sqrt{\color{blue}{y \cdot -4}}\right)}^{2} \]
    6. Applied egg-rr33.4%

      \[\leadsto \color{blue}{{\left(z \cdot \sqrt{y \cdot -4}\right)}^{2}} \]
    7. Step-by-step derivation
      1. unpow-prod-down28.0%

        \[\leadsto \color{blue}{{z}^{2} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}} \]
      2. unpow228.0%

        \[\leadsto \color{blue}{\left(z \cdot z\right)} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2} \]
      3. associate-*l*33.5%

        \[\leadsto \color{blue}{z \cdot \left(z \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}\right)} \]
      4. unpow233.5%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)}\right) \]
      5. add-sqr-sqrt86.9%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(y \cdot -4\right)}\right) \]
    8. Applied egg-rr86.9%

      \[\leadsto \color{blue}{z \cdot \left(z \cdot \left(y \cdot -4\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 7.2 \cdot 10^{+90}:\\ \;\;\;\;x \cdot x - y \cdot \left(t \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \]

Alternative 7: 45.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 5 \cdot 10^{+40}:\\ \;\;\;\;y \cdot \left(4 \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z 5e+40) (* y (* 4.0 t)) (* z (* z (* y -4.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 5e+40) {
		tmp = y * (4.0 * t);
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= 5d+40) then
        tmp = y * (4.0d0 * t)
    else
        tmp = z * (z * (y * (-4.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 5e+40) {
		tmp = y * (4.0 * t);
	} else {
		tmp = z * (z * (y * -4.0));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= 5e+40:
		tmp = y * (4.0 * t)
	else:
		tmp = z * (z * (y * -4.0))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= 5e+40)
		tmp = Float64(y * Float64(4.0 * t));
	else
		tmp = Float64(z * Float64(z * Float64(y * -4.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= 5e+40)
		tmp = y * (4.0 * t);
	else
		tmp = z * (z * (y * -4.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, 5e+40], N[(y * N[(4.0 * t), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{+40}:\\
\;\;\;\;y \cdot \left(4 \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 5.00000000000000003e40

    1. Initial program 91.5%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around 0 92.0%

      \[\leadsto x \cdot x - \color{blue}{\left(-4 \cdot \left(t \cdot y\right) + 4 \cdot \left(y \cdot {z}^{2}\right)\right)} \]
    3. Taylor expanded in t around inf 32.2%

      \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
    4. Step-by-step derivation
      1. associate-*r*32.2%

        \[\leadsto \color{blue}{\left(4 \cdot t\right) \cdot y} \]
      2. *-commutative32.2%

        \[\leadsto \color{blue}{y \cdot \left(4 \cdot t\right)} \]
      3. *-commutative32.2%

        \[\leadsto y \cdot \color{blue}{\left(t \cdot 4\right)} \]
    5. Simplified32.2%

      \[\leadsto \color{blue}{y \cdot \left(t \cdot 4\right)} \]

    if 5.00000000000000003e40 < z

    1. Initial program 77.0%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Taylor expanded in z around inf 69.1%

      \[\leadsto \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*69.1%

        \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    4. Simplified69.1%

      \[\leadsto \color{blue}{\left(-4 \cdot y\right) \cdot {z}^{2}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt27.7%

        \[\leadsto \color{blue}{\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}} \cdot \sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}} \]
      2. pow227.7%

        \[\leadsto \color{blue}{{\left(\sqrt{\left(-4 \cdot y\right) \cdot {z}^{2}}\right)}^{2}} \]
      3. *-commutative27.7%

        \[\leadsto {\left(\sqrt{\color{blue}{{z}^{2} \cdot \left(-4 \cdot y\right)}}\right)}^{2} \]
      4. sqrt-prod27.7%

        \[\leadsto {\color{blue}{\left(\sqrt{{z}^{2}} \cdot \sqrt{-4 \cdot y}\right)}}^{2} \]
      5. unpow227.7%

        \[\leadsto {\left(\sqrt{\color{blue}{z \cdot z}} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      6. sqrt-prod32.4%

        \[\leadsto {\left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      7. add-sqr-sqrt32.4%

        \[\leadsto {\left(\color{blue}{z} \cdot \sqrt{-4 \cdot y}\right)}^{2} \]
      8. *-commutative32.4%

        \[\leadsto {\left(z \cdot \sqrt{\color{blue}{y \cdot -4}}\right)}^{2} \]
    6. Applied egg-rr32.4%

      \[\leadsto \color{blue}{{\left(z \cdot \sqrt{y \cdot -4}\right)}^{2}} \]
    7. Step-by-step derivation
      1. unpow-prod-down27.7%

        \[\leadsto \color{blue}{{z}^{2} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}} \]
      2. unpow227.7%

        \[\leadsto \color{blue}{\left(z \cdot z\right)} \cdot {\left(\sqrt{y \cdot -4}\right)}^{2} \]
      3. associate-*l*32.5%

        \[\leadsto \color{blue}{z \cdot \left(z \cdot {\left(\sqrt{y \cdot -4}\right)}^{2}\right)} \]
      4. unpow232.5%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(\sqrt{y \cdot -4} \cdot \sqrt{y \cdot -4}\right)}\right) \]
      5. add-sqr-sqrt78.6%

        \[\leadsto z \cdot \left(z \cdot \color{blue}{\left(y \cdot -4\right)}\right) \]
    8. Applied egg-rr78.6%

      \[\leadsto \color{blue}{z \cdot \left(z \cdot \left(y \cdot -4\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification42.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 5 \cdot 10^{+40}:\\ \;\;\;\;y \cdot \left(4 \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\ \end{array} \]

Alternative 8: 31.0% accurate, 2.6× speedup?

\[\begin{array}{l} \\ 4 \cdot \left(y \cdot t\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (* 4.0 (* y t)))
double code(double x, double y, double z, double t) {
	return 4.0 * (y * t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = 4.0d0 * (y * t)
end function
public static double code(double x, double y, double z, double t) {
	return 4.0 * (y * t);
}
def code(x, y, z, t):
	return 4.0 * (y * t)
function code(x, y, z, t)
	return Float64(4.0 * Float64(y * t))
end
function tmp = code(x, y, z, t)
	tmp = 4.0 * (y * t);
end
code[x_, y_, z_, t_] := N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
4 \cdot \left(y \cdot t\right)
\end{array}
Derivation
  1. Initial program 88.2%

    \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
  2. Taylor expanded in t around inf 26.7%

    \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
  3. Step-by-step derivation
    1. *-commutative26.7%

      \[\leadsto 4 \cdot \color{blue}{\left(y \cdot t\right)} \]
  4. Simplified26.7%

    \[\leadsto \color{blue}{4 \cdot \left(y \cdot t\right)} \]
  5. Final simplification26.7%

    \[\leadsto 4 \cdot \left(y \cdot t\right) \]

Alternative 9: 31.0% accurate, 2.6× speedup?

\[\begin{array}{l} \\ y \cdot \left(4 \cdot t\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (* y (* 4.0 t)))
double code(double x, double y, double z, double t) {
	return y * (4.0 * t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = y * (4.0d0 * t)
end function
public static double code(double x, double y, double z, double t) {
	return y * (4.0 * t);
}
def code(x, y, z, t):
	return y * (4.0 * t)
function code(x, y, z, t)
	return Float64(y * Float64(4.0 * t))
end
function tmp = code(x, y, z, t)
	tmp = y * (4.0 * t);
end
code[x_, y_, z_, t_] := N[(y * N[(4.0 * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y \cdot \left(4 \cdot t\right)
\end{array}
Derivation
  1. Initial program 88.2%

    \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
  2. Taylor expanded in z around 0 85.0%

    \[\leadsto x \cdot x - \color{blue}{\left(-4 \cdot \left(t \cdot y\right) + 4 \cdot \left(y \cdot {z}^{2}\right)\right)} \]
  3. Taylor expanded in t around inf 26.7%

    \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
  4. Step-by-step derivation
    1. associate-*r*26.7%

      \[\leadsto \color{blue}{\left(4 \cdot t\right) \cdot y} \]
    2. *-commutative26.7%

      \[\leadsto \color{blue}{y \cdot \left(4 \cdot t\right)} \]
    3. *-commutative26.7%

      \[\leadsto y \cdot \color{blue}{\left(t \cdot 4\right)} \]
  5. Simplified26.7%

    \[\leadsto \color{blue}{y \cdot \left(t \cdot 4\right)} \]
  6. Final simplification26.7%

    \[\leadsto y \cdot \left(4 \cdot t\right) \]

Developer target: 89.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot x - 4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (- (* x x) (* 4.0 (* y (- (* z z) t)))))
double code(double x, double y, double z, double t) {
	return (x * x) - (4.0 * (y * ((z * z) - t)));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * x) - (4.0d0 * (y * ((z * z) - t)))
end function
public static double code(double x, double y, double z, double t) {
	return (x * x) - (4.0 * (y * ((z * z) - t)));
}
def code(x, y, z, t):
	return (x * x) - (4.0 * (y * ((z * z) - t)))
function code(x, y, z, t)
	return Float64(Float64(x * x) - Float64(4.0 * Float64(y * Float64(Float64(z * z) - t))))
end
function tmp = code(x, y, z, t)
	tmp = (x * x) - (4.0 * (y * ((z * z) - t)));
end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(4.0 * N[(y * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot x - 4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)
\end{array}

Reproduce

?
herbie shell --seed 2023305 
(FPCore (x y z t)
  :name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
  :precision binary64

  :herbie-target
  (- (* x x) (* 4.0 (* y (- (* z z) t))))

  (- (* x x) (* (* y 4.0) (- (* z z) t))))