Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23

Percentage Accurate: 99.9% → 99.9%
Time: 8.4s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, t\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma (fma x y z) y t))
double code(double x, double y, double z, double t) {
	return fma(fma(x, y, z), y, t);
}
function code(x, y, z, t)
	return fma(fma(x, y, z), y, t)
end
code[x_, y_, z_, t_] := N[(N[(x * y + z), $MachinePrecision] * y + t), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, t\right)
\end{array}
Derivation
  1. Initial program 99.9%

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, y, z\right)}, y, t\right) \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, t\right)} \]
  4. Add Preprocessing
  5. Final simplification99.9%

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, t\right) \]
  6. Add Preprocessing

Alternative 2: 63.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(y \cdot y\right)\\ \mathbf{if}\;y \leq -8.8 \cdot 10^{+55}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-46}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-56} \lor \neg \left(y \leq 3 \cdot 10^{-76}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (* y y))))
   (if (<= y -8.8e+55)
     t_1
     (if (<= y -6.2e-46)
       (* y z)
       (if (or (<= y -7.2e-56) (not (<= y 3e-76))) t_1 t)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (y * y);
	double tmp;
	if (y <= -8.8e+55) {
		tmp = t_1;
	} else if (y <= -6.2e-46) {
		tmp = y * z;
	} else if ((y <= -7.2e-56) || !(y <= 3e-76)) {
		tmp = t_1;
	} else {
		tmp = 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) :: t_1
    real(8) :: tmp
    t_1 = x * (y * y)
    if (y <= (-8.8d+55)) then
        tmp = t_1
    else if (y <= (-6.2d-46)) then
        tmp = y * z
    else if ((y <= (-7.2d-56)) .or. (.not. (y <= 3d-76))) then
        tmp = t_1
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (y * y);
	double tmp;
	if (y <= -8.8e+55) {
		tmp = t_1;
	} else if (y <= -6.2e-46) {
		tmp = y * z;
	} else if ((y <= -7.2e-56) || !(y <= 3e-76)) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (y * y)
	tmp = 0
	if y <= -8.8e+55:
		tmp = t_1
	elif y <= -6.2e-46:
		tmp = y * z
	elif (y <= -7.2e-56) or not (y <= 3e-76):
		tmp = t_1
	else:
		tmp = t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(y * y))
	tmp = 0.0
	if (y <= -8.8e+55)
		tmp = t_1;
	elseif (y <= -6.2e-46)
		tmp = Float64(y * z);
	elseif ((y <= -7.2e-56) || !(y <= 3e-76))
		tmp = t_1;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (y * y);
	tmp = 0.0;
	if (y <= -8.8e+55)
		tmp = t_1;
	elseif (y <= -6.2e-46)
		tmp = y * z;
	elseif ((y <= -7.2e-56) || ~((y <= 3e-76)))
		tmp = t_1;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.8e+55], t$95$1, If[LessEqual[y, -6.2e-46], N[(y * z), $MachinePrecision], If[Or[LessEqual[y, -7.2e-56], N[Not[LessEqual[y, 3e-76]], $MachinePrecision]], t$95$1, t]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq -8.8 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -6.2 \cdot 10^{-46}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;y \leq -7.2 \cdot 10^{-56} \lor \neg \left(y \leq 3 \cdot 10^{-76}\right):\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.80000000000000042e55 or -6.2000000000000002e-46 < y < -7.19999999999999956e-56 or 3.00000000000000024e-76 < y

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 81.7%

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

        \[\leadsto x \cdot \color{blue}{\left({y}^{2} + \frac{y \cdot z}{x}\right)} + t \]
      2. distribute-lft-in81.7%

        \[\leadsto \color{blue}{\left(x \cdot {y}^{2} + x \cdot \frac{y \cdot z}{x}\right)} + t \]
      3. unpow281.7%

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

        \[\leadsto \left(\color{blue}{\left(x \cdot y\right) \cdot y} + x \cdot \frac{y \cdot z}{x}\right) + t \]
      5. associate-/l*84.6%

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

        \[\leadsto \left(\left(x \cdot y\right) \cdot y + \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{x}}\right) + t \]
      7. distribute-lft-out97.1%

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \left(y + \frac{z}{x}\right)} + t \]
      8. *-commutative97.1%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \left(y + \frac{z}{x}\right) + t \]
    5. Simplified97.1%

      \[\leadsto \color{blue}{\left(y \cdot x\right) \cdot \left(y + \frac{z}{x}\right)} + t \]
    6. Taylor expanded in t around 0 79.4%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \left(y + \frac{z}{x}\right)\right)} \]
    7. Taylor expanded in y around inf 70.9%

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

    if -8.80000000000000042e55 < y < -6.2000000000000002e-46

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 90.8%

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

        \[\leadsto \color{blue}{-t \cdot \left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)} \]
      2. distribute-rgt-neg-in90.8%

        \[\leadsto \color{blue}{t \cdot \left(-\left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)\right)} \]
      3. fma-neg90.8%

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{y \cdot \color{blue}{\left(x \cdot y + z\right)}}{t}, -1\right)\right) \]
      5. fma-undefine90.8%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{y \cdot \color{blue}{\mathsf{fma}\left(x, y, z\right)}}{t}, -1\right)\right) \]
      6. *-commutative90.8%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{\color{blue}{\mathsf{fma}\left(x, y, z\right) \cdot y}}{t}, -1\right)\right) \]
      7. associate-/l*90.8%

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

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \left(\color{blue}{y \cdot x} + z\right) \cdot \frac{y}{t}, -1\right)\right) \]
      10. fma-undefine90.8%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \color{blue}{\mathsf{fma}\left(y, x, z\right)} \cdot \frac{y}{t}, -1\right)\right) \]
      11. metadata-eval90.8%

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

      \[\leadsto \color{blue}{t \cdot \left(-\mathsf{fma}\left(-1, \mathsf{fma}\left(y, x, z\right) \cdot \frac{y}{t}, -1\right)\right)} \]
    6. Taylor expanded in z around inf 49.6%

      \[\leadsto \color{blue}{y \cdot z} \]

    if -7.19999999999999956e-56 < y < 3.00000000000000024e-76

    1. Initial program 100.0%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 72.3%

      \[\leadsto \color{blue}{t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.8 \cdot 10^{+55}:\\ \;\;\;\;x \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-46}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-56} \lor \neg \left(y \leq 3 \cdot 10^{-76}\right):\\ \;\;\;\;x \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 63.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(y \cdot y\right)\\ \mathbf{if}\;y \leq -7.6 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-37}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{-56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-73}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (* y y))))
   (if (<= y -7.6e+54)
     t_1
     (if (<= y -9e-37)
       (* y z)
       (if (<= y -3.1e-56) t_1 (if (<= y 1.35e-73) t (* y (* x y))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (y * y);
	double tmp;
	if (y <= -7.6e+54) {
		tmp = t_1;
	} else if (y <= -9e-37) {
		tmp = y * z;
	} else if (y <= -3.1e-56) {
		tmp = t_1;
	} else if (y <= 1.35e-73) {
		tmp = t;
	} else {
		tmp = y * (x * y);
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = x * (y * y)
    if (y <= (-7.6d+54)) then
        tmp = t_1
    else if (y <= (-9d-37)) then
        tmp = y * z
    else if (y <= (-3.1d-56)) then
        tmp = t_1
    else if (y <= 1.35d-73) then
        tmp = t
    else
        tmp = y * (x * y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (y * y);
	double tmp;
	if (y <= -7.6e+54) {
		tmp = t_1;
	} else if (y <= -9e-37) {
		tmp = y * z;
	} else if (y <= -3.1e-56) {
		tmp = t_1;
	} else if (y <= 1.35e-73) {
		tmp = t;
	} else {
		tmp = y * (x * y);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (y * y)
	tmp = 0
	if y <= -7.6e+54:
		tmp = t_1
	elif y <= -9e-37:
		tmp = y * z
	elif y <= -3.1e-56:
		tmp = t_1
	elif y <= 1.35e-73:
		tmp = t
	else:
		tmp = y * (x * y)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(y * y))
	tmp = 0.0
	if (y <= -7.6e+54)
		tmp = t_1;
	elseif (y <= -9e-37)
		tmp = Float64(y * z);
	elseif (y <= -3.1e-56)
		tmp = t_1;
	elseif (y <= 1.35e-73)
		tmp = t;
	else
		tmp = Float64(y * Float64(x * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (y * y);
	tmp = 0.0;
	if (y <= -7.6e+54)
		tmp = t_1;
	elseif (y <= -9e-37)
		tmp = y * z;
	elseif (y <= -3.1e-56)
		tmp = t_1;
	elseif (y <= 1.35e-73)
		tmp = t;
	else
		tmp = y * (x * y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.6e+54], t$95$1, If[LessEqual[y, -9e-37], N[(y * z), $MachinePrecision], If[LessEqual[y, -3.1e-56], t$95$1, If[LessEqual[y, 1.35e-73], t, N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq -7.6 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -9 \cdot 10^{-37}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;y \leq -3.1 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{-73}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.6000000000000005e54 or -9.00000000000000081e-37 < y < -3.09999999999999987e-56

    1. Initial program 99.8%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 77.9%

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

        \[\leadsto x \cdot \color{blue}{\left({y}^{2} + \frac{y \cdot z}{x}\right)} + t \]
      2. distribute-lft-in77.9%

        \[\leadsto \color{blue}{\left(x \cdot {y}^{2} + x \cdot \frac{y \cdot z}{x}\right)} + t \]
      3. unpow277.9%

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

        \[\leadsto \left(\color{blue}{\left(x \cdot y\right) \cdot y} + x \cdot \frac{y \cdot z}{x}\right) + t \]
      5. associate-/l*82.5%

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

        \[\leadsto \left(\left(x \cdot y\right) \cdot y + \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{x}}\right) + t \]
      7. distribute-lft-out98.3%

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \left(y + \frac{z}{x}\right)} + t \]
      8. *-commutative98.3%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \left(y + \frac{z}{x}\right) + t \]
    5. Simplified98.3%

      \[\leadsto \color{blue}{\left(y \cdot x\right) \cdot \left(y + \frac{z}{x}\right)} + t \]
    6. Taylor expanded in t around 0 84.7%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \left(y + \frac{z}{x}\right)\right)} \]
    7. Taylor expanded in y around inf 76.3%

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

    if -7.6000000000000005e54 < y < -9.00000000000000081e-37

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 90.8%

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

        \[\leadsto \color{blue}{-t \cdot \left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)} \]
      2. distribute-rgt-neg-in90.8%

        \[\leadsto \color{blue}{t \cdot \left(-\left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)\right)} \]
      3. fma-neg90.8%

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{y \cdot \color{blue}{\left(x \cdot y + z\right)}}{t}, -1\right)\right) \]
      5. fma-undefine90.8%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{y \cdot \color{blue}{\mathsf{fma}\left(x, y, z\right)}}{t}, -1\right)\right) \]
      6. *-commutative90.8%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{\color{blue}{\mathsf{fma}\left(x, y, z\right) \cdot y}}{t}, -1\right)\right) \]
      7. associate-/l*90.8%

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

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \left(\color{blue}{y \cdot x} + z\right) \cdot \frac{y}{t}, -1\right)\right) \]
      10. fma-undefine90.8%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \color{blue}{\mathsf{fma}\left(y, x, z\right)} \cdot \frac{y}{t}, -1\right)\right) \]
      11. metadata-eval90.8%

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

      \[\leadsto \color{blue}{t \cdot \left(-\mathsf{fma}\left(-1, \mathsf{fma}\left(y, x, z\right) \cdot \frac{y}{t}, -1\right)\right)} \]
    6. Taylor expanded in z around inf 49.6%

      \[\leadsto \color{blue}{y \cdot z} \]

    if -3.09999999999999987e-56 < y < 1.34999999999999997e-73

    1. Initial program 100.0%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 72.3%

      \[\leadsto \color{blue}{t} \]

    if 1.34999999999999997e-73 < y

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 89.6%

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

        \[\leadsto \color{blue}{-t \cdot \left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)} \]
      2. distribute-rgt-neg-in89.6%

        \[\leadsto \color{blue}{t \cdot \left(-\left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)\right)} \]
      3. fma-neg89.6%

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{y \cdot \color{blue}{\left(x \cdot y + z\right)}}{t}, -1\right)\right) \]
      5. fma-undefine89.6%

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{\color{blue}{\mathsf{fma}\left(x, y, z\right) \cdot y}}{t}, -1\right)\right) \]
      7. associate-/l*88.2%

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

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \left(\color{blue}{y \cdot x} + z\right) \cdot \frac{y}{t}, -1\right)\right) \]
      10. fma-undefine88.2%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \color{blue}{\mathsf{fma}\left(y, x, z\right)} \cdot \frac{y}{t}, -1\right)\right) \]
      11. metadata-eval88.2%

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

      \[\leadsto \color{blue}{t \cdot \left(-\mathsf{fma}\left(-1, \mathsf{fma}\left(y, x, z\right) \cdot \frac{y}{t}, -1\right)\right)} \]
    6. Taylor expanded in t around 0 82.7%

      \[\leadsto \color{blue}{y \cdot \left(z + x \cdot y\right)} \]
    7. Taylor expanded in z around 0 70.3%

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

        \[\leadsto y \cdot \color{blue}{\left(y \cdot x\right)} \]
    9. Simplified70.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{+54}:\\ \;\;\;\;x \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-37}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{-56}:\\ \;\;\;\;x \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-73}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 89.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+24} \lor \neg \left(y \leq 2.5 \cdot 10^{-6}\right):\\ \;\;\;\;y \cdot \left(z + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -2.4e+24) (not (<= y 2.5e-6)))
   (* y (+ z (* x y)))
   (+ t (* y z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -2.4e+24) || !(y <= 2.5e-6)) {
		tmp = y * (z + (x * y));
	} else {
		tmp = t + (y * z);
	}
	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 ((y <= (-2.4d+24)) .or. (.not. (y <= 2.5d-6))) then
        tmp = y * (z + (x * y))
    else
        tmp = t + (y * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -2.4e+24) || !(y <= 2.5e-6)) {
		tmp = y * (z + (x * y));
	} else {
		tmp = t + (y * z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -2.4e+24) or not (y <= 2.5e-6):
		tmp = y * (z + (x * y))
	else:
		tmp = t + (y * z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -2.4e+24) || !(y <= 2.5e-6))
		tmp = Float64(y * Float64(z + Float64(x * y)));
	else
		tmp = Float64(t + Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -2.4e+24) || ~((y <= 2.5e-6)))
		tmp = y * (z + (x * y));
	else
		tmp = t + (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.4e+24], N[Not[LessEqual[y, 2.5e-6]], $MachinePrecision]], N[(y * N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+24} \lor \neg \left(y \leq 2.5 \cdot 10^{-6}\right):\\
\;\;\;\;y \cdot \left(z + x \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;t + y \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.4000000000000001e24 or 2.5000000000000002e-6 < y

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 91.7%

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

        \[\leadsto \color{blue}{-t \cdot \left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)} \]
      2. distribute-rgt-neg-in91.7%

        \[\leadsto \color{blue}{t \cdot \left(-\left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)\right)} \]
      3. fma-neg91.7%

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{y \cdot \color{blue}{\left(x \cdot y + z\right)}}{t}, -1\right)\right) \]
      5. fma-undefine91.7%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{y \cdot \color{blue}{\mathsf{fma}\left(x, y, z\right)}}{t}, -1\right)\right) \]
      6. *-commutative91.7%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{\color{blue}{\mathsf{fma}\left(x, y, z\right) \cdot y}}{t}, -1\right)\right) \]
      7. associate-/l*90.8%

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

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \left(\color{blue}{y \cdot x} + z\right) \cdot \frac{y}{t}, -1\right)\right) \]
      10. fma-undefine90.8%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \color{blue}{\mathsf{fma}\left(y, x, z\right)} \cdot \frac{y}{t}, -1\right)\right) \]
      11. metadata-eval90.8%

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

      \[\leadsto \color{blue}{t \cdot \left(-\mathsf{fma}\left(-1, \mathsf{fma}\left(y, x, z\right) \cdot \frac{y}{t}, -1\right)\right)} \]
    6. Taylor expanded in t around 0 91.5%

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

    if -2.4000000000000001e24 < y < 2.5000000000000002e-6

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 86.6%

      \[\leadsto \color{blue}{z} \cdot y + t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.9%

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

Alternative 5: 88.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+139} \lor \neg \left(z \leq 2.1 \cdot 10^{+63}\right):\\
\;\;\;\;t + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.79999999999999993e139 or 2.1000000000000002e63 < z

    1. Initial program 100.0%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 90.0%

      \[\leadsto \color{blue}{z} \cdot y + t \]

    if -1.79999999999999993e139 < z < 2.1000000000000002e63

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 92.0%

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

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot y + t \]
    5. Simplified92.0%

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

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

Alternative 6: 78.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{+51}:\\
\;\;\;\;x \cdot \left(y \cdot y\right)\\

\mathbf{elif}\;y \leq 30500:\\
\;\;\;\;t + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.39999999999999983e51

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 75.6%

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

        \[\leadsto x \cdot \color{blue}{\left({y}^{2} + \frac{y \cdot z}{x}\right)} + t \]
      2. distribute-lft-in75.6%

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

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

        \[\leadsto \left(\color{blue}{\left(x \cdot y\right) \cdot y} + x \cdot \frac{y \cdot z}{x}\right) + t \]
      5. associate-/l*82.0%

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

        \[\leadsto \left(\left(x \cdot y\right) \cdot y + \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{x}}\right) + t \]
      7. distribute-lft-out99.9%

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \left(y + \frac{z}{x}\right)} + t \]
      8. *-commutative99.9%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \left(y + \frac{z}{x}\right) + t \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{\left(y \cdot x\right) \cdot \left(y + \frac{z}{x}\right)} + t \]
    6. Taylor expanded in t around 0 85.9%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \left(y + \frac{z}{x}\right)\right)} \]
    7. Taylor expanded in y around inf 75.9%

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

    if -5.39999999999999983e51 < y < 30500

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 85.9%

      \[\leadsto \color{blue}{z} \cdot y + t \]

    if 30500 < y

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 90.0%

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

        \[\leadsto \color{blue}{-t \cdot \left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)} \]
      2. distribute-rgt-neg-in90.0%

        \[\leadsto \color{blue}{t \cdot \left(-\left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)\right)} \]
      3. fma-neg90.0%

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{y \cdot \color{blue}{\left(x \cdot y + z\right)}}{t}, -1\right)\right) \]
      5. fma-undefine90.0%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{y \cdot \color{blue}{\mathsf{fma}\left(x, y, z\right)}}{t}, -1\right)\right) \]
      6. *-commutative90.0%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{\color{blue}{\mathsf{fma}\left(x, y, z\right) \cdot y}}{t}, -1\right)\right) \]
      7. associate-/l*88.2%

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

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \left(\color{blue}{y \cdot x} + z\right) \cdot \frac{y}{t}, -1\right)\right) \]
      10. fma-undefine88.2%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \color{blue}{\mathsf{fma}\left(y, x, z\right)} \cdot \frac{y}{t}, -1\right)\right) \]
      11. metadata-eval88.2%

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

      \[\leadsto \color{blue}{t \cdot \left(-\mathsf{fma}\left(-1, \mathsf{fma}\left(y, x, z\right) \cdot \frac{y}{t}, -1\right)\right)} \]
    6. Taylor expanded in t around 0 88.1%

      \[\leadsto \color{blue}{y \cdot \left(z + x \cdot y\right)} \]
    7. Taylor expanded in z around 0 78.9%

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

        \[\leadsto y \cdot \color{blue}{\left(y \cdot x\right)} \]
    9. Simplified78.9%

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

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

Alternative 7: 51.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+129} \lor \neg \left(z \leq 7.6 \cdot 10^{+81}\right):\\
\;\;\;\;y \cdot z\\

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.09999999999999997e129 or 7.599999999999999e81 < z

    1. Initial program 100.0%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 89.6%

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

        \[\leadsto \color{blue}{-t \cdot \left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)} \]
      2. distribute-rgt-neg-in89.6%

        \[\leadsto \color{blue}{t \cdot \left(-\left(-1 \cdot \frac{y \cdot \left(z + x \cdot y\right)}{t} - 1\right)\right)} \]
      3. fma-neg89.6%

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{y \cdot \color{blue}{\left(x \cdot y + z\right)}}{t}, -1\right)\right) \]
      5. fma-undefine89.6%

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \frac{\color{blue}{\mathsf{fma}\left(x, y, z\right) \cdot y}}{t}, -1\right)\right) \]
      7. associate-/l*89.5%

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

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

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \left(\color{blue}{y \cdot x} + z\right) \cdot \frac{y}{t}, -1\right)\right) \]
      10. fma-undefine89.5%

        \[\leadsto t \cdot \left(-\mathsf{fma}\left(-1, \color{blue}{\mathsf{fma}\left(y, x, z\right)} \cdot \frac{y}{t}, -1\right)\right) \]
      11. metadata-eval89.5%

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

      \[\leadsto \color{blue}{t \cdot \left(-\mathsf{fma}\left(-1, \mathsf{fma}\left(y, x, z\right) \cdot \frac{y}{t}, -1\right)\right)} \]
    6. Taylor expanded in z around inf 67.7%

      \[\leadsto \color{blue}{y \cdot z} \]

    if -2.09999999999999997e129 < z < 7.599999999999999e81

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 45.1%

      \[\leadsto \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+129} \lor \neg \left(z \leq 7.6 \cdot 10^{+81}\right):\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 99.9% accurate, 1.0× speedup?

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

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

    \[\left(x \cdot y + z\right) \cdot y + t \]
  2. Add Preprocessing
  3. Final simplification99.9%

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

Alternative 9: 38.2% accurate, 9.0× speedup?

\[\begin{array}{l} \\ t \end{array} \]
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
	return 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 = t
end function
public static double code(double x, double y, double z, double t) {
	return t;
}
def code(x, y, z, t):
	return t
function code(x, y, z, t)
	return t
end
function tmp = code(x, y, z, t)
	tmp = t;
end
code[x_, y_, z_, t_] := t
\begin{array}{l}

\\
t
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(x \cdot y + z\right) \cdot y + t \]
  2. Add Preprocessing
  3. Taylor expanded in y around 0 38.2%

    \[\leadsto \color{blue}{t} \]
  4. Final simplification38.2%

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2024077 
(FPCore (x y z t)
  :name "Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23"
  :precision binary64
  (+ (* (+ (* x y) z) y) t))