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

Percentage Accurate: 90.7% → 96.1%
Time: 11.2s
Alternatives: 12
Speedup: 0.9×

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 12 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: 90.7% 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: 96.1% accurate, 0.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y #s(literal 4 binary64)) < 4.99999999999999969e-99

    1. Initial program 93.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6494.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified94.2%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \left(t + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(t \cdot y + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right) \cdot y}\right)\right)\right) \]
      3. fma-defineN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{fma}\left(t, \color{blue}{y}, \left(\mathsf{neg}\left(z \cdot z\right)\right) \cdot y\right)\right)\right)\right) \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{fma}\left(t, y, \mathsf{neg}\left(\left(z \cdot z\right) \cdot y\right)\right)\right)\right)\right) \]
      5. fmm-undefN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(t \cdot y - \color{blue}{\left(z \cdot z\right) \cdot y}\right)\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\left(t \cdot y\right), \color{blue}{\left(\left(z \cdot z\right) \cdot y\right)}\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\left(y \cdot t\right), \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\left(z \cdot z\right), \color{blue}{y}\right)\right)\right)\right) \]
      10. *-lowering-*.f6494.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), y\right)\right)\right)\right) \]
    6. Applied egg-rr94.2%

      \[\leadsto x \cdot x + 4 \cdot \color{blue}{\left(y \cdot t - \left(z \cdot z\right) \cdot y\right)} \]
    7. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \left(z \cdot \color{blue}{\left(z \cdot y\right)}\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \left(\left(z \cdot y\right) \cdot \color{blue}{z}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\left(z \cdot y\right), \color{blue}{z}\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\left(y \cdot z\right), z\right)\right)\right)\right) \]
      5. *-lowering-*.f6499.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, z\right), z\right)\right)\right)\right) \]
    8. Applied egg-rr99.9%

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

    if 4.99999999999999969e-99 < (*.f64 y #s(literal 4 binary64))

    1. Initial program 93.0%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6493.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified93.0%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-defineN/A

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{x}, 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)\right) \]
      2. fma-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(x, \color{blue}{x}, \left(4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{fma.f64}\left(x, x, \left(\left(4 \cdot y\right) \cdot \left(t - z \cdot z\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(x, x, \left(\left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{fma.f64}\left(x, x, \left(y \cdot \left(4 \cdot \left(t - z \cdot z\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(x, x, \mathsf{*.f64}\left(y, \left(4 \cdot \left(t - z \cdot z\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(x, x, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(4, \left(t - z \cdot z\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(x, x, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(t, \left(z \cdot z\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f6497.6%

        \[\leadsto \mathsf{fma.f64}\left(x, x, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, z\right)\right)\right)\right)\right) \]
    6. Applied egg-rr97.6%

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

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

Alternative 2: 89.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+55}:\\ \;\;\;\;x \cdot x + 4 \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;z \cdot z \leq 10^{+282}:\\ \;\;\;\;x \cdot x + y \cdot \left(\left(z \cdot z\right) \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(y \cdot z\right)\right) \cdot -4\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 5e+55)
   (+ (* x x) (* 4.0 (* y t)))
   (if (<= (* z z) 1e+282)
     (+ (* x x) (* y (* (* z z) -4.0)))
     (* (* z (* y z)) -4.0))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 5e+55) {
		tmp = (x * x) + (4.0 * (y * t));
	} else if ((z * z) <= 1e+282) {
		tmp = (x * x) + (y * ((z * z) * -4.0));
	} else {
		tmp = (z * (y * z)) * -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) <= 5d+55) then
        tmp = (x * x) + (4.0d0 * (y * t))
    else if ((z * z) <= 1d+282) then
        tmp = (x * x) + (y * ((z * z) * (-4.0d0)))
    else
        tmp = (z * (y * z)) * (-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) <= 5e+55) {
		tmp = (x * x) + (4.0 * (y * t));
	} else if ((z * z) <= 1e+282) {
		tmp = (x * x) + (y * ((z * z) * -4.0));
	} else {
		tmp = (z * (y * z)) * -4.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z * z) <= 5e+55:
		tmp = (x * x) + (4.0 * (y * t))
	elif (z * z) <= 1e+282:
		tmp = (x * x) + (y * ((z * z) * -4.0))
	else:
		tmp = (z * (y * z)) * -4.0
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * z) <= 5e+55)
		tmp = Float64(Float64(x * x) + Float64(4.0 * Float64(y * t)));
	elseif (Float64(z * z) <= 1e+282)
		tmp = Float64(Float64(x * x) + Float64(y * Float64(Float64(z * z) * -4.0)));
	else
		tmp = Float64(Float64(z * Float64(y * z)) * -4.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z * z) <= 5e+55)
		tmp = (x * x) + (4.0 * (y * t));
	elseif ((z * z) <= 1e+282)
		tmp = (x * x) + (y * ((z * z) * -4.0));
	else
		tmp = (z * (y * z)) * -4.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e+55], N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * z), $MachinePrecision], 1e+282], N[(N[(x * x), $MachinePrecision] + N[(y * N[(N[(z * z), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \cdot z \leq 10^{+282}:\\
\;\;\;\;x \cdot x + y \cdot \left(\left(z \cdot z\right) \cdot -4\right)\\

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


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

    1. Initial program 99.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6499.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0

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

        \[\leadsto {x}^{2} + \color{blue}{4 \cdot \left(t \cdot y\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({x}^{2}\right), \color{blue}{\left(4 \cdot \left(t \cdot y\right)\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \left(\color{blue}{4} \cdot \left(t \cdot y\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{4} \cdot \left(t \cdot y\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(t \cdot y\right)}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{t}\right)\right)\right) \]
      7. *-lowering-*.f6491.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{t}\right)\right)\right) \]
    7. Simplified91.0%

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

    if 5.00000000000000046e55 < (*.f64 z z) < 1.00000000000000003e282

    1. Initial program 97.8%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6497.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified97.8%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0

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

        \[\leadsto {x}^{2} + \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({x}^{2}\right), \color{blue}{\left(-4 \cdot \left(y \cdot {z}^{2}\right)\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \left(\color{blue}{-4} \cdot \left(y \cdot {z}^{2}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{-4} \cdot \left(y \cdot {z}^{2}\right)\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\left(-4 \cdot y\right) \cdot \color{blue}{{z}^{2}}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\left(y \cdot -4\right) \cdot {\color{blue}{z}}^{2}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \color{blue}{\left(-4 \cdot {z}^{2}\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \left({z}^{2} \cdot \color{blue}{-4}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left({z}^{2}\right), \color{blue}{-4}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left(z \cdot z\right), -4\right)\right)\right) \]
      12. *-lowering-*.f6488.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), -4\right)\right)\right) \]
    7. Simplified88.5%

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

    if 1.00000000000000003e282 < (*.f64 z z)

    1. Initial program 71.4%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6471.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified71.4%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf

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

        \[\leadsto \left(-4 \cdot y\right) \cdot \color{blue}{{z}^{2}} \]
      2. *-commutativeN/A

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

        \[\leadsto y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(-4 \cdot {z}^{2}\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(y, \left({z}^{2} \cdot \color{blue}{-4}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left({z}^{2}\right), \color{blue}{-4}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left(z \cdot z\right), -4\right)\right) \]
      8. *-lowering-*.f6479.2%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), -4\right)\right) \]
    7. Simplified79.2%

      \[\leadsto \color{blue}{y \cdot \left(\left(z \cdot z\right) \cdot -4\right)} \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(y \cdot \left(z \cdot z\right)\right) \cdot \color{blue}{-4} \]
      2. associate-*r*N/A

        \[\leadsto \left(\left(y \cdot z\right) \cdot z\right) \cdot -4 \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot \left(y \cdot z\right)\right) \cdot -4 \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(z \cdot \left(y \cdot z\right)\right), \color{blue}{-4}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, \left(y \cdot z\right)\right), -4\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, \left(z \cdot y\right)\right), -4\right) \]
      7. *-lowering-*.f6492.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, \mathsf{*.f64}\left(z, y\right)\right), -4\right) \]
    9. Applied egg-rr92.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+55}:\\ \;\;\;\;x \cdot x + 4 \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;z \cdot z \leq 10^{+282}:\\ \;\;\;\;x \cdot x + y \cdot \left(\left(z \cdot z\right) \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(y \cdot z\right)\right) \cdot -4\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 94.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 3.3 \cdot 10^{+167}:\\ \;\;\;\;x \cdot x + 4 \cdot \left(y \cdot t - z \cdot \left(y \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(1 + \frac{y \cdot \frac{\left(z \cdot z\right) \cdot -4}{x}}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x 3.3e+167)
   (+ (* x x) (* 4.0 (- (* y t) (* z (* y z)))))
   (* (* x x) (+ 1.0 (/ (* y (/ (* (* z z) -4.0) x)) x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= 3.3e+167) {
		tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z))));
	} else {
		tmp = (x * x) * (1.0 + ((y * (((z * z) * -4.0) / x)) / x));
	}
	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 (x <= 3.3d+167) then
        tmp = (x * x) + (4.0d0 * ((y * t) - (z * (y * z))))
    else
        tmp = (x * x) * (1.0d0 + ((y * (((z * z) * (-4.0d0)) / x)) / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= 3.3e+167) {
		tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z))));
	} else {
		tmp = (x * x) * (1.0 + ((y * (((z * z) * -4.0) / x)) / x));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= 3.3e+167:
		tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z))))
	else:
		tmp = (x * x) * (1.0 + ((y * (((z * z) * -4.0) / x)) / x))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= 3.3e+167)
		tmp = Float64(Float64(x * x) + Float64(4.0 * Float64(Float64(y * t) - Float64(z * Float64(y * z)))));
	else
		tmp = Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(y * Float64(Float64(Float64(z * z) * -4.0) / x)) / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= 3.3e+167)
		tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z))));
	else
		tmp = (x * x) * (1.0 + ((y * (((z * z) * -4.0) / x)) / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, 3.3e+167], N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(N[(y * t), $MachinePrecision] - N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(y * N[(N[(N[(z * z), $MachinePrecision] * -4.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 3.30000000000000018e167

    1. Initial program 94.1%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6494.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified94.5%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \left(t + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(t \cdot y + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right) \cdot y}\right)\right)\right) \]
      3. fma-defineN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{fma}\left(t, \color{blue}{y}, \left(\mathsf{neg}\left(z \cdot z\right)\right) \cdot y\right)\right)\right)\right) \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{fma}\left(t, y, \mathsf{neg}\left(\left(z \cdot z\right) \cdot y\right)\right)\right)\right)\right) \]
      5. fmm-undefN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(t \cdot y - \color{blue}{\left(z \cdot z\right) \cdot y}\right)\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\left(t \cdot y\right), \color{blue}{\left(\left(z \cdot z\right) \cdot y\right)}\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\left(y \cdot t\right), \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\left(z \cdot z\right), \color{blue}{y}\right)\right)\right)\right) \]
      10. *-lowering-*.f6493.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), y\right)\right)\right)\right) \]
    6. Applied egg-rr93.7%

      \[\leadsto x \cdot x + 4 \cdot \color{blue}{\left(y \cdot t - \left(z \cdot z\right) \cdot y\right)} \]
    7. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \left(z \cdot \color{blue}{\left(z \cdot y\right)}\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \left(\left(z \cdot y\right) \cdot \color{blue}{z}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\left(z \cdot y\right), \color{blue}{z}\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\left(y \cdot z\right), z\right)\right)\right)\right) \]
      5. *-lowering-*.f6497.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, z\right), z\right)\right)\right)\right) \]
    8. Applied egg-rr97.3%

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

    if 3.30000000000000018e167 < x

    1. Initial program 86.4%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6486.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified86.4%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0

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

        \[\leadsto {x}^{2} + \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({x}^{2}\right), \color{blue}{\left(-4 \cdot \left(y \cdot {z}^{2}\right)\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \left(\color{blue}{-4} \cdot \left(y \cdot {z}^{2}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{-4} \cdot \left(y \cdot {z}^{2}\right)\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\left(-4 \cdot y\right) \cdot \color{blue}{{z}^{2}}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\left(y \cdot -4\right) \cdot {\color{blue}{z}}^{2}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \color{blue}{\left(-4 \cdot {z}^{2}\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \left({z}^{2} \cdot \color{blue}{-4}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left({z}^{2}\right), \color{blue}{-4}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left(z \cdot z\right), -4\right)\right)\right) \]
      12. *-lowering-*.f6486.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), -4\right)\right)\right) \]
    7. Simplified86.4%

      \[\leadsto \color{blue}{x \cdot x + y \cdot \left(\left(z \cdot z\right) \cdot -4\right)} \]
    8. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{2} \cdot \left(1 + -4 \cdot \frac{y \cdot {z}^{2}}{{x}^{2}}\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2}\right), \color{blue}{\left(1 + -4 \cdot \frac{y \cdot {z}^{2}}{{x}^{2}}\right)}\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\color{blue}{1} + -4 \cdot \frac{y \cdot {z}^{2}}{{x}^{2}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{1} + -4 \cdot \frac{y \cdot {z}^{2}}{{x}^{2}}\right)\right) \]
      4. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \left(\frac{-4 \cdot \left(y \cdot {z}^{2}\right)}{\color{blue}{{x}^{2}}}\right)\right)\right) \]
      6. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{-4 \cdot \left(y \cdot {z}^{2}\right)}{x}}{\color{blue}{x}}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\left(y \cdot {z}^{2}\right) \cdot -4}{x}\right), x\right)\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{y \cdot \left({z}^{2} \cdot -4\right)}{x}\right), x\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{y \cdot \left(-4 \cdot {z}^{2}\right)}{x}\right), x\right)\right)\right) \]
      12. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(y \cdot \frac{-4 \cdot {z}^{2}}{x}\right), x\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{-4 \cdot {z}^{2}}{x}\right)\right), x\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(\left(-4 \cdot {z}^{2}\right), x\right)\right), x\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(\left({z}^{2} \cdot -4\right), x\right)\right), x\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({z}^{2}\right), -4\right), x\right)\right), x\right)\right)\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(z \cdot z\right), -4\right), x\right)\right), x\right)\right)\right) \]
      18. *-lowering-*.f6495.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), -4\right), x\right)\right), x\right)\right)\right) \]
    10. Simplified95.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.3 \cdot 10^{+167}:\\ \;\;\;\;x \cdot x + 4 \cdot \left(y \cdot t - z \cdot \left(y \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(1 + \frac{y \cdot \frac{\left(z \cdot z\right) \cdot -4}{x}}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 60.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 6.2 \cdot 10^{-165}:\\ \;\;\;\;4 \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot x \leq 1.66 \cdot 10^{+74}:\\ \;\;\;\;\left(z \cdot \left(y \cdot z\right)\right) \cdot -4\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* x x) 6.2e-165)
   (* 4.0 (* y t))
   (if (<= (* x x) 1.66e+74) (* (* z (* y z)) -4.0) (* x x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x * x) <= 6.2e-165) {
		tmp = 4.0 * (y * t);
	} else if ((x * x) <= 1.66e+74) {
		tmp = (z * (y * z)) * -4.0;
	} else {
		tmp = x * x;
	}
	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 ((x * x) <= 6.2d-165) then
        tmp = 4.0d0 * (y * t)
    else if ((x * x) <= 1.66d+74) then
        tmp = (z * (y * z)) * (-4.0d0)
    else
        tmp = x * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x * x) <= 6.2e-165) {
		tmp = 4.0 * (y * t);
	} else if ((x * x) <= 1.66e+74) {
		tmp = (z * (y * z)) * -4.0;
	} else {
		tmp = x * x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x * x) <= 6.2e-165:
		tmp = 4.0 * (y * t)
	elif (x * x) <= 1.66e+74:
		tmp = (z * (y * z)) * -4.0
	else:
		tmp = x * x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(x * x) <= 6.2e-165)
		tmp = Float64(4.0 * Float64(y * t));
	elseif (Float64(x * x) <= 1.66e+74)
		tmp = Float64(Float64(z * Float64(y * z)) * -4.0);
	else
		tmp = Float64(x * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x * x) <= 6.2e-165)
		tmp = 4.0 * (y * t);
	elseif ((x * x) <= 1.66e+74)
		tmp = (z * (y * z)) * -4.0;
	else
		tmp = x * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 6.2e-165], N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 1.66e+74], N[(N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], N[(x * x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 6.2 \cdot 10^{-165}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\

\mathbf{elif}\;x \cdot x \leq 1.66 \cdot 10^{+74}:\\
\;\;\;\;\left(z \cdot \left(y \cdot z\right)\right) \cdot -4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x x) < 6.19999999999999992e-165

    1. Initial program 97.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6498.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

      \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(4, \color{blue}{\left(t \cdot y\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{t}\right)\right) \]
      3. *-lowering-*.f6458.9%

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{t}\right)\right) \]
    7. Simplified58.9%

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

    if 6.19999999999999992e-165 < (*.f64 x x) < 1.66000000000000001e74

    1. Initial program 94.2%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6494.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified94.2%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf

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

        \[\leadsto \left(-4 \cdot y\right) \cdot \color{blue}{{z}^{2}} \]
      2. *-commutativeN/A

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

        \[\leadsto y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(-4 \cdot {z}^{2}\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(y, \left({z}^{2} \cdot \color{blue}{-4}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left({z}^{2}\right), \color{blue}{-4}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left(z \cdot z\right), -4\right)\right) \]
      8. *-lowering-*.f6450.0%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), -4\right)\right) \]
    7. Simplified50.0%

      \[\leadsto \color{blue}{y \cdot \left(\left(z \cdot z\right) \cdot -4\right)} \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(y \cdot \left(z \cdot z\right)\right) \cdot \color{blue}{-4} \]
      2. associate-*r*N/A

        \[\leadsto \left(\left(y \cdot z\right) \cdot z\right) \cdot -4 \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot \left(y \cdot z\right)\right) \cdot -4 \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(z \cdot \left(y \cdot z\right)\right), \color{blue}{-4}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, \left(y \cdot z\right)\right), -4\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, \left(z \cdot y\right)\right), -4\right) \]
      7. *-lowering-*.f6455.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, \mathsf{*.f64}\left(z, y\right)\right), -4\right) \]
    9. Applied egg-rr55.6%

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

    if 1.66000000000000001e74 < (*.f64 x x)

    1. Initial program 88.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6488.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified88.7%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{2}} \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto x \cdot \color{blue}{x} \]
      2. *-lowering-*.f6477.0%

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{x}\right) \]
    7. Simplified77.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 6.2 \cdot 10^{-165}:\\ \;\;\;\;4 \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot x \leq 1.66 \cdot 10^{+74}:\\ \;\;\;\;\left(z \cdot \left(y \cdot z\right)\right) \cdot -4\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 95.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot z \leq 10^{+282}:\\ \;\;\;\;x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(y \cdot z\right)\right) \cdot -4\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 1e+282)
   (+ (* x x) (* 4.0 (* y (- t (* z z)))))
   (* (* z (* y z)) -4.0)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * z) <= 1e+282) {
		tmp = (x * x) + (4.0 * (y * (t - (z * z))));
	} else {
		tmp = (z * (y * z)) * -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) <= 1d+282) then
        tmp = (x * x) + (4.0d0 * (y * (t - (z * z))))
    else
        tmp = (z * (y * z)) * (-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) <= 1e+282) {
		tmp = (x * x) + (4.0 * (y * (t - (z * z))));
	} else {
		tmp = (z * (y * z)) * -4.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z * z) <= 1e+282:
		tmp = (x * x) + (4.0 * (y * (t - (z * z))))
	else:
		tmp = (z * (y * z)) * -4.0
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * z) <= 1e+282)
		tmp = Float64(Float64(x * x) + Float64(4.0 * Float64(y * Float64(t - Float64(z * z)))));
	else
		tmp = Float64(Float64(z * Float64(y * z)) * -4.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z * z) <= 1e+282)
		tmp = (x * x) + (4.0 * (y * (t - (z * z))));
	else
		tmp = (z * (y * z)) * -4.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 1e+282], N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(y * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 98.9%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6499.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing

    if 1.00000000000000003e282 < (*.f64 z z)

    1. Initial program 71.4%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6471.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified71.4%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf

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

        \[\leadsto \left(-4 \cdot y\right) \cdot \color{blue}{{z}^{2}} \]
      2. *-commutativeN/A

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

        \[\leadsto y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(-4 \cdot {z}^{2}\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(y, \left({z}^{2} \cdot \color{blue}{-4}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left({z}^{2}\right), \color{blue}{-4}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left(z \cdot z\right), -4\right)\right) \]
      8. *-lowering-*.f6479.2%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), -4\right)\right) \]
    7. Simplified79.2%

      \[\leadsto \color{blue}{y \cdot \left(\left(z \cdot z\right) \cdot -4\right)} \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(y \cdot \left(z \cdot z\right)\right) \cdot \color{blue}{-4} \]
      2. associate-*r*N/A

        \[\leadsto \left(\left(y \cdot z\right) \cdot z\right) \cdot -4 \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot \left(y \cdot z\right)\right) \cdot -4 \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(z \cdot \left(y \cdot z\right)\right), \color{blue}{-4}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, \left(y \cdot z\right)\right), -4\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, \left(z \cdot y\right)\right), -4\right) \]
      7. *-lowering-*.f6492.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, \mathsf{*.f64}\left(z, y\right)\right), -4\right) \]
    9. Applied egg-rr92.1%

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

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

Alternative 6: 89.4% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 99.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6499.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0

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

        \[\leadsto {x}^{2} + \color{blue}{4 \cdot \left(t \cdot y\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({x}^{2}\right), \color{blue}{\left(4 \cdot \left(t \cdot y\right)\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \left(\color{blue}{4} \cdot \left(t \cdot y\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{4} \cdot \left(t \cdot y\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(t \cdot y\right)}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{t}\right)\right)\right) \]
      7. *-lowering-*.f6491.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{t}\right)\right)\right) \]
    7. Simplified91.0%

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

    if 5.00000000000000046e55 < (*.f64 z z)

    1. Initial program 84.9%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6484.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified84.9%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0

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

        \[\leadsto {x}^{2} + \color{blue}{-4 \cdot \left(y \cdot {z}^{2}\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({x}^{2}\right), \color{blue}{\left(-4 \cdot \left(y \cdot {z}^{2}\right)\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \left(\color{blue}{-4} \cdot \left(y \cdot {z}^{2}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{-4} \cdot \left(y \cdot {z}^{2}\right)\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\left(-4 \cdot y\right) \cdot \color{blue}{{z}^{2}}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\left(y \cdot -4\right) \cdot {\color{blue}{z}}^{2}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \color{blue}{\left(-4 \cdot {z}^{2}\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \left({z}^{2} \cdot \color{blue}{-4}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left({z}^{2}\right), \color{blue}{-4}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left(z \cdot z\right), -4\right)\right)\right) \]
      12. *-lowering-*.f6480.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), -4\right)\right)\right) \]
    7. Simplified80.1%

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

        \[\leadsto y \cdot \left(\left(z \cdot z\right) \cdot -4\right) + \color{blue}{x \cdot x} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(y \cdot \left(\left(z \cdot z\right) \cdot -4\right)\right), \color{blue}{\left(x \cdot x\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(y \cdot \left(z \cdot z\right)\right) \cdot -4\right), \left(\color{blue}{x} \cdot x\right)\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(y \cdot z\right) \cdot z\right) \cdot -4\right), \left(x \cdot x\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(z \cdot \left(y \cdot z\right)\right) \cdot -4\right), \left(x \cdot x\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(z \cdot \left(\left(y \cdot z\right) \cdot -4\right)\right), \left(\color{blue}{x} \cdot x\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(z, \left(\left(y \cdot z\right) \cdot -4\right)\right), \left(\color{blue}{x} \cdot x\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(y \cdot z\right), -4\right)\right), \left(x \cdot x\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, z\right), -4\right)\right), \left(x \cdot x\right)\right) \]
      10. *-lowering-*.f6489.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, z\right), -4\right)\right), \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right) \]
    9. Applied egg-rr89.3%

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

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

Alternative 7: 45.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.4 \cdot 10^{-83}:\\ \;\;\;\;4 \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{+37}:\\ \;\;\;\;y \cdot \left(\left(z \cdot z\right) \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x 1.4e-83)
   (* 4.0 (* y t))
   (if (<= x 1.02e+37) (* y (* (* z z) -4.0)) (* x x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= 1.4e-83) {
		tmp = 4.0 * (y * t);
	} else if (x <= 1.02e+37) {
		tmp = y * ((z * z) * -4.0);
	} else {
		tmp = x * x;
	}
	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 (x <= 1.4d-83) then
        tmp = 4.0d0 * (y * t)
    else if (x <= 1.02d+37) then
        tmp = y * ((z * z) * (-4.0d0))
    else
        tmp = x * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= 1.4e-83) {
		tmp = 4.0 * (y * t);
	} else if (x <= 1.02e+37) {
		tmp = y * ((z * z) * -4.0);
	} else {
		tmp = x * x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= 1.4e-83:
		tmp = 4.0 * (y * t)
	elif x <= 1.02e+37:
		tmp = y * ((z * z) * -4.0)
	else:
		tmp = x * x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= 1.4e-83)
		tmp = Float64(4.0 * Float64(y * t));
	elseif (x <= 1.02e+37)
		tmp = Float64(y * Float64(Float64(z * z) * -4.0));
	else
		tmp = Float64(x * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= 1.4e-83)
		tmp = 4.0 * (y * t);
	elseif (x <= 1.02e+37)
		tmp = y * ((z * z) * -4.0);
	else
		tmp = x * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, 1.4e-83], N[(4.0 * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.02e+37], N[(y * N[(N[(z * z), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{-83}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\

\mathbf{elif}\;x \leq 1.02 \cdot 10^{+37}:\\
\;\;\;\;y \cdot \left(\left(z \cdot z\right) \cdot -4\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 1.4e-83

    1. Initial program 95.0%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6495.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified95.6%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

      \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(4, \color{blue}{\left(t \cdot y\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{t}\right)\right) \]
      3. *-lowering-*.f6445.6%

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{t}\right)\right) \]
    7. Simplified45.6%

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

    if 1.4e-83 < x < 1.01999999999999995e37

    1. Initial program 92.4%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6492.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified92.4%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf

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

        \[\leadsto \left(-4 \cdot y\right) \cdot \color{blue}{{z}^{2}} \]
      2. *-commutativeN/A

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

        \[\leadsto y \cdot \color{blue}{\left(-4 \cdot {z}^{2}\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(-4 \cdot {z}^{2}\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(y, \left({z}^{2} \cdot \color{blue}{-4}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left({z}^{2}\right), \color{blue}{-4}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\left(z \cdot z\right), -4\right)\right) \]
      8. *-lowering-*.f6453.0%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), -4\right)\right) \]
    7. Simplified53.0%

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

    if 1.01999999999999995e37 < x

    1. Initial program 88.8%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6488.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified88.8%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{2}} \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto x \cdot \color{blue}{x} \]
      2. *-lowering-*.f6474.7%

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{x}\right) \]
    7. Simplified74.7%

      \[\leadsto \color{blue}{x \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 82.3% accurate, 0.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot x + 4 \cdot \left(y \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x x) < 1.1000000000000001e74

    1. Initial program 96.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6496.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified96.9%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \color{blue}{4 \cdot \left(y \cdot \left(t - {z}^{2}\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(4, \color{blue}{\left(y \cdot \left(t - {z}^{2}\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(t - {z}^{2}\right)}\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left({z}^{2}\right)}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{z}\right)\right)\right)\right) \]
      5. *-lowering-*.f6488.5%

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right) \]
    7. Simplified88.5%

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

    if 1.1000000000000001e74 < (*.f64 x x)

    1. Initial program 88.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6488.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified88.7%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0

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

        \[\leadsto {x}^{2} + \color{blue}{4 \cdot \left(t \cdot y\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left({x}^{2}\right), \color{blue}{\left(4 \cdot \left(t \cdot y\right)\right)}\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \left(\color{blue}{4} \cdot \left(t \cdot y\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{4} \cdot \left(t \cdot y\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(t \cdot y\right)}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{t}\right)\right)\right) \]
      7. *-lowering-*.f6484.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{t}\right)\right)\right) \]
    7. Simplified84.1%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 79.9% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x x) < 2.0999999999999999e74

    1. Initial program 96.3%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6496.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified96.9%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \color{blue}{4 \cdot \left(y \cdot \left(t - {z}^{2}\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(4, \color{blue}{\left(y \cdot \left(t - {z}^{2}\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(t - {z}^{2}\right)}\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left({z}^{2}\right)}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{z}\right)\right)\right)\right) \]
      5. *-lowering-*.f6488.5%

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right) \]
    7. Simplified88.5%

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

    if 2.0999999999999999e74 < (*.f64 x x)

    1. Initial program 88.7%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6488.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified88.7%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{2}} \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto x \cdot \color{blue}{x} \]
      2. *-lowering-*.f6477.0%

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{x}\right) \]
    7. Simplified77.0%

      \[\leadsto \color{blue}{x \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 93.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ x \cdot x + 4 \cdot \left(y \cdot t - z \cdot \left(y \cdot z\right)\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (* x x) (* 4.0 (- (* y t) (* z (* y z))))))
double code(double x, double y, double z, double t) {
	return (x * x) + (4.0 * ((y * t) - (z * (y * z))));
}
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 * t) - (z * (y * z))))
end function
public static double code(double x, double y, double z, double t) {
	return (x * x) + (4.0 * ((y * t) - (z * (y * z))));
}
def code(x, y, z, t):
	return (x * x) + (4.0 * ((y * t) - (z * (y * z))))
function code(x, y, z, t)
	return Float64(Float64(x * x) + Float64(4.0 * Float64(Float64(y * t) - Float64(z * Float64(y * z)))))
end
function tmp = code(x, y, z, t)
	tmp = (x * x) + (4.0 * ((y * t) - (z * (y * z))));
end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] + N[(4.0 * N[(N[(y * t), $MachinePrecision] - N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot x + 4 \cdot \left(y \cdot t - z \cdot \left(y \cdot z\right)\right)
\end{array}
Derivation
  1. Initial program 93.5%

    \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
  2. Step-by-step derivation
    1. sub-negN/A

      \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
    2. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
    6. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
    10. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
    14. distribute-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
    15. unsub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
    16. remove-double-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
    17. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
    18. *-lowering-*.f6493.8%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
  3. Simplified93.8%

    \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. sub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \left(t + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
    2. distribute-rgt-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(t \cdot y + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right) \cdot y}\right)\right)\right) \]
    3. fma-defineN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{fma}\left(t, \color{blue}{y}, \left(\mathsf{neg}\left(z \cdot z\right)\right) \cdot y\right)\right)\right)\right) \]
    4. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{fma}\left(t, y, \mathsf{neg}\left(\left(z \cdot z\right) \cdot y\right)\right)\right)\right)\right) \]
    5. fmm-undefN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(t \cdot y - \color{blue}{\left(z \cdot z\right) \cdot y}\right)\right)\right) \]
    6. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\left(t \cdot y\right), \color{blue}{\left(\left(z \cdot z\right) \cdot y\right)}\right)\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\left(y \cdot t\right), \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right)\right)\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \left(\color{blue}{\left(z \cdot z\right)} \cdot y\right)\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\left(z \cdot z\right), \color{blue}{y}\right)\right)\right)\right) \]
    10. *-lowering-*.f6493.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), y\right)\right)\right)\right) \]
  6. Applied egg-rr93.0%

    \[\leadsto x \cdot x + 4 \cdot \color{blue}{\left(y \cdot t - \left(z \cdot z\right) \cdot y\right)} \]
  7. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \left(z \cdot \color{blue}{\left(z \cdot y\right)}\right)\right)\right)\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \left(\left(z \cdot y\right) \cdot \color{blue}{z}\right)\right)\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\left(z \cdot y\right), \color{blue}{z}\right)\right)\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\left(y \cdot z\right), z\right)\right)\right)\right) \]
    5. *-lowering-*.f6496.8%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(y, t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, z\right), z\right)\right)\right)\right) \]
  8. Applied egg-rr96.8%

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

    \[\leadsto x \cdot x + 4 \cdot \left(y \cdot t - z \cdot \left(y \cdot z\right)\right) \]
  10. Add Preprocessing

Alternative 11: 45.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.4 \cdot 10^{+17}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 6.4e17

    1. Initial program 94.5%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6495.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified95.0%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

      \[\leadsto \color{blue}{4 \cdot \left(t \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(4, \color{blue}{\left(t \cdot y\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{t}\right)\right) \]
      3. *-lowering-*.f6443.2%

        \[\leadsto \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{t}\right)\right) \]
    7. Simplified43.2%

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

    if 6.4e17 < x

    1. Initial program 89.9%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
      16. remove-double-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
      18. *-lowering-*.f6489.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
    3. Simplified89.9%

      \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{2}} \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto x \cdot \color{blue}{x} \]
      2. *-lowering-*.f6469.0%

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{x}\right) \]
    7. Simplified69.0%

      \[\leadsto \color{blue}{x \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 40.8% accurate, 4.3× speedup?

\[\begin{array}{l} \\ x \cdot x \end{array} \]
(FPCore (x y z t) :precision binary64 (* x x))
double code(double x, double y, double z, double t) {
	return x * x;
}
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
end function
public static double code(double x, double y, double z, double t) {
	return x * x;
}
def code(x, y, z, t):
	return x * x
function code(x, y, z, t)
	return Float64(x * x)
end
function tmp = code(x, y, z, t)
	tmp = x * x;
end
code[x_, y_, z_, t_] := N[(x * x), $MachinePrecision]
\begin{array}{l}

\\
x \cdot x
\end{array}
Derivation
  1. Initial program 93.5%

    \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
  2. Step-by-step derivation
    1. sub-negN/A

      \[\leadsto x \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)} \]
    2. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\right)\right)}\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)}\right)\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(\left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\right)\right)\right) \]
    5. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\mathsf{neg}\left(4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
    6. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)}\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(4 \cdot \left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right) \cdot y\right)\right)}\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(\mathsf{neg}\left(y \cdot \left(z \cdot z - t\right)\right)\right)\right)\right) \]
    10. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(\left(z \cdot z - t\right)\right)\right)}\right)\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(z \cdot z + \left(\mathsf{neg}\left(t\right)\right)\right)\right)\right)\right)\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(t\right)\right) + z \cdot z\right)\right)\right)\right)\right)\right) \]
    14. distribute-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot z\right)\right)}\right)\right)\right)\right) \]
    15. unsub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right) - \color{blue}{z \cdot z}\right)\right)\right)\right) \]
    16. remove-double-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \left(t - \color{blue}{z} \cdot z\right)\right)\right)\right) \]
    17. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{\left(z \cdot z\right)}\right)\right)\right)\right) \]
    18. *-lowering-*.f6493.8%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{z}\right)\right)\right)\right)\right) \]
  3. Simplified93.8%

    \[\leadsto \color{blue}{x \cdot x + 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf

    \[\leadsto \color{blue}{{x}^{2}} \]
  6. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto x \cdot \color{blue}{x} \]
    2. *-lowering-*.f6435.8%

      \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{x}\right) \]
  7. Simplified35.8%

    \[\leadsto \color{blue}{x \cdot x} \]
  8. Add Preprocessing

Developer Target 1: 90.8% 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 2024145 
(FPCore (x y z t)
  :name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
  :precision binary64

  :alt
  (! :herbie-platform default (- (* x x) (* 4 (* y (- (* z z) t)))))

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