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

Percentage Accurate: 99.9% → 99.8%
Time: 7.1s
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.8% accurate, 0.7× speedup?

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

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

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

      \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot \left(x \cdot y\right) - z \cdot z}{x \cdot y - z}} \cdot y + t \]
    2. clear-num65.8%

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

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

      \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(x, y, -z\right)}{\color{blue}{{\left(x \cdot y\right)}^{2}} - z \cdot z}} \cdot y + t \]
  3. Applied egg-rr65.8%

    \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, y, -z\right)}{{\left(x \cdot y\right)}^{2} - z \cdot z}}} \cdot y + t \]
  4. Step-by-step derivation
    1. clear-num65.8%

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

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

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

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

      \[\leadsto \frac{\left(y \cdot x\right) \cdot \left(y \cdot x\right) - z \cdot z}{\color{blue}{y \cdot x} - z} \cdot y + t \]
    6. flip-+99.9%

      \[\leadsto \color{blue}{\left(y \cdot x + z\right)} \cdot y + t \]
    7. add-sqr-sqrt51.5%

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

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

      \[\leadsto \left(y \cdot x + \sqrt{\color{blue}{\left(-z\right) \cdot \left(-z\right)}}\right) \cdot y + t \]
    10. sqrt-unprod36.7%

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

      \[\leadsto \left(y \cdot x + \color{blue}{\left(-z\right)}\right) \cdot y + t \]
    12. sub-neg75.2%

      \[\leadsto \color{blue}{\left(y \cdot x - z\right)} \cdot y + t \]
    13. *-un-lft-identity75.2%

      \[\leadsto \left(y \cdot x - \color{blue}{1 \cdot z}\right) \cdot y + t \]
    14. prod-diff75.2%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(y, x, -z \cdot 1\right) + \mathsf{fma}\left(-z, 1, z \cdot 1\right)\right)} \cdot y + t \]
    15. add-sqr-sqrt36.7%

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

      \[\leadsto \left(\mathsf{fma}\left(y, x, -z \cdot 1\right) + \mathsf{fma}\left(\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}, 1, z \cdot 1\right)\right) \cdot y + t \]
    17. sqr-neg77.1%

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

      \[\leadsto \left(\mathsf{fma}\left(y, x, -z \cdot 1\right) + \mathsf{fma}\left(\color{blue}{\sqrt{z} \cdot \sqrt{z}}, 1, z \cdot 1\right)\right) \cdot y + t \]
    19. add-sqr-sqrt100.0%

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

    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(y, x, -z \cdot 1\right) + \mathsf{fma}\left(z, 1, z \cdot 1\right)\right)} \cdot y + t \]
  6. Step-by-step derivation
    1. fma-udef100.0%

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

      \[\leadsto \left(\mathsf{fma}\left(y, x, -z \cdot 1\right) + \left(\color{blue}{z} + z \cdot 1\right)\right) \cdot y + t \]
    3. *-rgt-identity100.0%

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

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

      \[\leadsto \left(\color{blue}{\left(y \cdot x - z\right)} + \left(z + z\right)\right) \cdot y + t \]
  7. Simplified100.0%

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

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

Alternative 2: 80.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+140} \lor \neg \left(y \leq -1.1 \cdot 10^{+104} \lor \neg \left(y \leq -1.7 \cdot 10^{+80}\right) \land y \leq 2.5 \cdot 10^{+61}\right):\\
\;\;\;\;y \cdot \left(y \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.7999999999999998e140 or -1.1e104 < y < -1.69999999999999996e80 or 2.50000000000000009e61 < y

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot y + z, y, t\right)} \]
      2. fma-def99.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. Taylor expanded in t around 0 96.4%

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

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

    if -5.7999999999999998e140 < y < -1.1e104 or -1.69999999999999996e80 < y < 2.50000000000000009e61

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+140} \lor \neg \left(y \leq -1.1 \cdot 10^{+104} \lor \neg \left(y \leq -1.7 \cdot 10^{+80}\right) \land y \leq 2.5 \cdot 10^{+61}\right):\\ \;\;\;\;y \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot z\\ \end{array} \]

Alternative 3: 65.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \left(y \cdot x\right)\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{-25}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.18 \cdot 10^{-24}:\\
\;\;\;\;t\\

\mathbf{elif}\;y \leq 122:\\
\;\;\;\;y \cdot z\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.8999999999999999e-25 or 122 < y

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot y + z, y, t\right)} \]
      2. fma-def99.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. Taylor expanded in t around 0 85.5%

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

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

    if -1.8999999999999999e-25 < y < 1.18e-24

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, t\right)} \]
    4. Taylor expanded in y around 0 70.7%

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

    if 1.18e-24 < y < 122

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, t\right)} \]
    4. Taylor expanded in t around 0 89.3%

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

      \[\leadsto \color{blue}{z} \cdot y \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{-25}:\\ \;\;\;\;y \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;y \leq 1.18 \cdot 10^{-24}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 122:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(y \cdot x\right)\\ \end{array} \]

Alternative 4: 89.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-25} \lor \neg \left(y \leq 3.3 \cdot 10^{-22}\right):\\
\;\;\;\;y \cdot \left(y \cdot x + z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.8e-25 or 3.3000000000000001e-22 < y

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot y + z, y, t\right)} \]
      2. fma-def99.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. Taylor expanded in t around 0 86.3%

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

    if -1.8e-25 < y < 3.3000000000000001e-22

    1. Initial program 100.0%

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

      \[\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 -1.8 \cdot 10^{-25} \lor \neg \left(y \leq 3.3 \cdot 10^{-22}\right):\\ \;\;\;\;y \cdot \left(y \cdot x + z\right)\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot z\\ \end{array} \]

Alternative 5: 84.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+173} \lor \neg \left(z \leq 52000\right):\\
\;\;\;\;t + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.4999999999999999e173 or 52000 < z

    1. Initial program 100.0%

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

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

    if -3.4999999999999999e173 < z < 52000

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \left(\color{blue}{x \cdot y} + z\right) \cdot y + t \]
      3. flip-+79.1%

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

        \[\leadsto \frac{\color{blue}{{\left(x \cdot y\right)}^{2}} - z \cdot z}{x \cdot y - z} \cdot y + t \]
      5. unsub-neg79.1%

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

        \[\leadsto \frac{{\left(x \cdot y\right)}^{2} - z \cdot z}{\color{blue}{\mathsf{fma}\left(x, y, -z\right)}} \cdot y + t \]
      7. associate-/r/77.9%

        \[\leadsto \color{blue}{\frac{{\left(x \cdot y\right)}^{2} - z \cdot z}{\frac{\mathsf{fma}\left(x, y, -z\right)}{y}}} + t \]
      8. associate-/l*76.8%

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

        \[\leadsto \color{blue}{\frac{-\left({\left(x \cdot y\right)}^{2} - z \cdot z\right) \cdot y}{-\mathsf{fma}\left(x, y, -z\right)}} + t \]
    6. Applied egg-rr76.8%

      \[\leadsto \color{blue}{\frac{y \cdot \left(-{\left(\mathsf{fma}\left(y, x, z\right)\right)}^{2}\right)}{-\mathsf{fma}\left(y, x, z\right)}} + t \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out76.8%

        \[\leadsto \frac{\color{blue}{-y \cdot {\left(\mathsf{fma}\left(y, x, z\right)\right)}^{2}}}{-\mathsf{fma}\left(y, x, z\right)} + t \]
      2. distribute-neg-frac76.8%

        \[\leadsto \color{blue}{\left(-\frac{y \cdot {\left(\mathsf{fma}\left(y, x, z\right)\right)}^{2}}{-\mathsf{fma}\left(y, x, z\right)}\right)} + t \]
      3. associate-/l*79.0%

        \[\leadsto \left(-\color{blue}{\frac{y}{\frac{-\mathsf{fma}\left(y, x, z\right)}{{\left(\mathsf{fma}\left(y, x, z\right)\right)}^{2}}}}\right) + t \]
      4. distribute-neg-frac79.0%

        \[\leadsto \color{blue}{\frac{-y}{\frac{-\mathsf{fma}\left(y, x, z\right)}{{\left(\mathsf{fma}\left(y, x, z\right)\right)}^{2}}}} + t \]
      5. distribute-frac-neg79.0%

        \[\leadsto \frac{-y}{\color{blue}{-\frac{\mathsf{fma}\left(y, x, z\right)}{{\left(\mathsf{fma}\left(y, x, z\right)\right)}^{2}}}} + t \]
      6. unpow279.0%

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

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

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

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

      \[\leadsto \color{blue}{{y}^{2} \cdot x} + t \]
    10. Step-by-step derivation
      1. unpow286.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+173} \lor \neg \left(z \leq 52000\right):\\ \;\;\;\;t + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t + x \cdot \left(y \cdot y\right)\\ \end{array} \]

Alternative 6: 87.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+172} \lor \neg \left(z \leq 1200\right):\\
\;\;\;\;t + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.7999999999999997e172 or 1200 < z

    1. Initial program 100.0%

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

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

    if -3.7999999999999997e172 < z < 1200

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+172} \lor \neg \left(z \leq 1200\right):\\ \;\;\;\;t + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \left(y \cdot x\right)\\ \end{array} \]

Alternative 7: 99.9% accurate, 1.0× speedup?

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

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

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

    \[\leadsto t + y \cdot \left(y \cdot x + z\right) \]

Alternative 8: 51.7% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+85}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;z \leq 1.38 \cdot 10^{+45}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.89999999999999997e85 or 1.3799999999999999e45 < z

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, t\right)} \]
    4. Taylor expanded in t around 0 77.8%

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

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

    if -2.89999999999999997e85 < z < 1.3799999999999999e45

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot y + z, y, t\right)} \]
      2. fma-def99.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. Taylor expanded in y around 0 50.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+85}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 1.38 \cdot 10^{+45}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 9: 37.4% 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. Step-by-step derivation
    1. fma-def99.9%

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, t\right)} \]
  4. Taylor expanded in y around 0 40.4%

    \[\leadsto \color{blue}{t} \]
  5. Final simplification40.4%

    \[\leadsto t \]

Reproduce

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