
(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:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(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}
Initial program 99.9%
fma-def99.9%
fma-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (or (<= y -1.95e+99)
(not (or (<= y 8.5e+37) (and (not (<= y 4.7e+74)) (<= y 1.55e+104)))))
(* y (* x y))
(+ t (* y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.95e+99) || !((y <= 8.5e+37) || (!(y <= 4.7e+74) && (y <= 1.55e+104)))) {
tmp = y * (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 <= (-1.95d+99)) .or. (.not. (y <= 8.5d+37) .or. (.not. (y <= 4.7d+74)) .and. (y <= 1.55d+104))) then
tmp = y * (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 <= -1.95e+99) || !((y <= 8.5e+37) || (!(y <= 4.7e+74) && (y <= 1.55e+104)))) {
tmp = y * (x * y);
} else {
tmp = t + (y * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.95e+99) or not ((y <= 8.5e+37) or (not (y <= 4.7e+74) and (y <= 1.55e+104))): tmp = y * (x * y) else: tmp = t + (y * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.95e+99) || !((y <= 8.5e+37) || (!(y <= 4.7e+74) && (y <= 1.55e+104)))) tmp = Float64(y * 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 <= -1.95e+99) || ~(((y <= 8.5e+37) || (~((y <= 4.7e+74)) && (y <= 1.55e+104))))) tmp = y * (x * y); else tmp = t + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.95e+99], N[Not[Or[LessEqual[y, 8.5e+37], And[N[Not[LessEqual[y, 4.7e+74]], $MachinePrecision], LessEqual[y, 1.55e+104]]]], $MachinePrecision]], N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(t + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{+99} \lor \neg \left(y \leq 8.5 \cdot 10^{+37} \lor \neg \left(y \leq 4.7 \cdot 10^{+74}\right) \land y \leq 1.55 \cdot 10^{+104}\right):\\
\;\;\;\;y \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t + y \cdot z\\
\end{array}
\end{array}
if y < -1.94999999999999997e99 or 8.4999999999999999e37 < y < 4.70000000000000044e74 or 1.55000000000000008e104 < y Initial program 99.9%
Taylor expanded in t around 0 93.5%
Taylor expanded in y around inf 77.2%
if -1.94999999999999997e99 < y < 8.4999999999999999e37 or 4.70000000000000044e74 < y < 1.55000000000000008e104Initial program 100.0%
Taylor expanded in x around 0 87.3%
Final simplification83.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (* x y))))
(if (<= y -2.2e+38)
t_1
(if (<= y 3.3e-177)
t
(if (<= y 1.12e-162) (* y z) (if (<= y 2.35e-7) t t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x * y);
double tmp;
if (y <= -2.2e+38) {
tmp = t_1;
} else if (y <= 3.3e-177) {
tmp = t;
} else if (y <= 1.12e-162) {
tmp = y * z;
} else if (y <= 2.35e-7) {
tmp = t;
} 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 * (x * y)
if (y <= (-2.2d+38)) then
tmp = t_1
else if (y <= 3.3d-177) then
tmp = t
else if (y <= 1.12d-162) then
tmp = y * z
else if (y <= 2.35d-7) then
tmp = t
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 * (x * y);
double tmp;
if (y <= -2.2e+38) {
tmp = t_1;
} else if (y <= 3.3e-177) {
tmp = t;
} else if (y <= 1.12e-162) {
tmp = y * z;
} else if (y <= 2.35e-7) {
tmp = t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x * y) tmp = 0 if y <= -2.2e+38: tmp = t_1 elif y <= 3.3e-177: tmp = t elif y <= 1.12e-162: tmp = y * z elif y <= 2.35e-7: tmp = t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x * y)) tmp = 0.0 if (y <= -2.2e+38) tmp = t_1; elseif (y <= 3.3e-177) tmp = t; elseif (y <= 1.12e-162) tmp = Float64(y * z); elseif (y <= 2.35e-7) tmp = t; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (x * y); tmp = 0.0; if (y <= -2.2e+38) tmp = t_1; elseif (y <= 3.3e-177) tmp = t; elseif (y <= 1.12e-162) tmp = y * z; elseif (y <= 2.35e-7) tmp = t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+38], t$95$1, If[LessEqual[y, 3.3e-177], t, If[LessEqual[y, 1.12e-162], N[(y * z), $MachinePrecision], If[LessEqual[y, 2.35e-7], t, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot y\right)\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-177}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{-162}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{-7}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.20000000000000006e38 or 2.35e-7 < y Initial program 99.9%
Taylor expanded in t around 0 91.1%
Taylor expanded in y around inf 64.9%
if -2.20000000000000006e38 < y < 3.3e-177 or 1.12e-162 < y < 2.35e-7Initial program 100.0%
Taylor expanded in y around 0 67.6%
if 3.3e-177 < y < 1.12e-162Initial program 99.7%
Taylor expanded in t around 0 87.7%
Taylor expanded in y around 0 87.7%
Final simplification66.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ z (* x y)))))
(if (<= y -4.1e+32)
t_1
(if (<= y -5e-96)
(+ t (* x (* y y)))
(if (<= y 1.9e-15) (+ t (* y z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (z + (x * y));
double tmp;
if (y <= -4.1e+32) {
tmp = t_1;
} else if (y <= -5e-96) {
tmp = t + (x * (y * y));
} else if (y <= 1.9e-15) {
tmp = t + (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 * (z + (x * y))
if (y <= (-4.1d+32)) then
tmp = t_1
else if (y <= (-5d-96)) then
tmp = t + (x * (y * y))
else if (y <= 1.9d-15) then
tmp = t + (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 * (z + (x * y));
double tmp;
if (y <= -4.1e+32) {
tmp = t_1;
} else if (y <= -5e-96) {
tmp = t + (x * (y * y));
} else if (y <= 1.9e-15) {
tmp = t + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (z + (x * y)) tmp = 0 if y <= -4.1e+32: tmp = t_1 elif y <= -5e-96: tmp = t + (x * (y * y)) elif y <= 1.9e-15: tmp = t + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(z + Float64(x * y))) tmp = 0.0 if (y <= -4.1e+32) tmp = t_1; elseif (y <= -5e-96) tmp = Float64(t + Float64(x * Float64(y * y))); elseif (y <= 1.9e-15) tmp = Float64(t + Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (z + (x * y)); tmp = 0.0; if (y <= -4.1e+32) tmp = t_1; elseif (y <= -5e-96) tmp = t + (x * (y * y)); elseif (y <= 1.9e-15) tmp = t + (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.1e+32], t$95$1, If[LessEqual[y, -5e-96], N[(t + N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-15], N[(t + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z + x \cdot y\right)\\
\mathbf{if}\;y \leq -4.1 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-96}:\\
\;\;\;\;t + x \cdot \left(y \cdot y\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-15}:\\
\;\;\;\;t + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.09999999999999981e32 or 1.9000000000000001e-15 < y Initial program 99.9%
Taylor expanded in t around 0 91.2%
if -4.09999999999999981e32 < y < -4.99999999999999995e-96Initial program 99.9%
*-commutative99.9%
distribute-rgt-in99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 85.9%
unpow285.9%
*-commutative85.9%
Simplified85.9%
if -4.99999999999999995e-96 < y < 1.9000000000000001e-15Initial program 100.0%
Taylor expanded in x around 0 95.5%
Final simplification92.6%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.6e+158)
(* y z)
(if (<= z -4e+115)
t
(if (<= z -6.6e+54) (* y z) (if (<= z 2.32e+36) t (* y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.6e+158) {
tmp = y * z;
} else if (z <= -4e+115) {
tmp = t;
} else if (z <= -6.6e+54) {
tmp = y * z;
} else if (z <= 2.32e+36) {
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.6d+158)) then
tmp = y * z
else if (z <= (-4d+115)) then
tmp = t
else if (z <= (-6.6d+54)) then
tmp = y * z
else if (z <= 2.32d+36) 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.6e+158) {
tmp = y * z;
} else if (z <= -4e+115) {
tmp = t;
} else if (z <= -6.6e+54) {
tmp = y * z;
} else if (z <= 2.32e+36) {
tmp = t;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.6e+158: tmp = y * z elif z <= -4e+115: tmp = t elif z <= -6.6e+54: tmp = y * z elif z <= 2.32e+36: tmp = t else: tmp = y * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.6e+158) tmp = Float64(y * z); elseif (z <= -4e+115) tmp = t; elseif (z <= -6.6e+54) tmp = Float64(y * z); elseif (z <= 2.32e+36) 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.6e+158) tmp = y * z; elseif (z <= -4e+115) tmp = t; elseif (z <= -6.6e+54) tmp = y * z; elseif (z <= 2.32e+36) tmp = t; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.6e+158], N[(y * z), $MachinePrecision], If[LessEqual[z, -4e+115], t, If[LessEqual[z, -6.6e+54], N[(y * z), $MachinePrecision], If[LessEqual[z, 2.32e+36], t, N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+158}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+115}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{+54}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 2.32 \cdot 10^{+36}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -2.6e158 or -4.0000000000000001e115 < z < -6.6e54 or 2.31999999999999996e36 < z Initial program 100.0%
Taylor expanded in t around 0 77.5%
Taylor expanded in y around 0 63.5%
if -2.6e158 < z < -4.0000000000000001e115 or -6.6e54 < z < 2.31999999999999996e36Initial program 99.9%
Taylor expanded in y around 0 49.5%
Final simplification55.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.8e+99) (not (<= y 4.4e-10))) (* y (+ z (* x y))) (+ t (* y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8e+99) || !(y <= 4.4e-10)) {
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 <= (-1.8d+99)) .or. (.not. (y <= 4.4d-10))) 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 <= -1.8e+99) || !(y <= 4.4e-10)) {
tmp = y * (z + (x * y));
} else {
tmp = t + (y * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.8e+99) or not (y <= 4.4e-10): tmp = y * (z + (x * y)) else: tmp = t + (y * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.8e+99) || !(y <= 4.4e-10)) 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 <= -1.8e+99) || ~((y <= 4.4e-10))) tmp = y * (z + (x * y)); else tmp = t + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.8e+99], N[Not[LessEqual[y, 4.4e-10]], $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 -1.8 \cdot 10^{+99} \lor \neg \left(y \leq 4.4 \cdot 10^{-10}\right):\\
\;\;\;\;y \cdot \left(z + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t + y \cdot z\\
\end{array}
\end{array}
if y < -1.8000000000000001e99 or 4.3999999999999998e-10 < y Initial program 99.9%
Taylor expanded in t around 0 92.3%
if -1.8000000000000001e99 < y < 4.3999999999999998e-10Initial program 100.0%
Taylor expanded in x around 0 89.5%
Final simplification90.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.05e+61) (not (<= z 1.4e+64))) (+ t (* y z)) (+ t (* y (* x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e+61) || !(z <= 1.4e+64)) {
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.05d+61)) .or. (.not. (z <= 1.4d+64))) 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.05e+61) || !(z <= 1.4e+64)) {
tmp = t + (y * z);
} else {
tmp = t + (y * (x * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.05e+61) or not (z <= 1.4e+64): tmp = t + (y * z) else: tmp = t + (y * (x * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.05e+61) || !(z <= 1.4e+64)) 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.05e+61) || ~((z <= 1.4e+64))) 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.05e+61], N[Not[LessEqual[z, 1.4e+64]], $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.05 \cdot 10^{+61} \lor \neg \left(z \leq 1.4 \cdot 10^{+64}\right):\\
\;\;\;\;t + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t + y \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if z < -1.0500000000000001e61 or 1.40000000000000012e64 < z Initial program 100.0%
Taylor expanded in x around 0 88.4%
if -1.0500000000000001e61 < z < 1.40000000000000012e64Initial program 99.9%
Taylor expanded in x around inf 95.5%
Final simplification92.3%
(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}
Initial program 99.9%
Final simplification99.9%
(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}
Initial program 99.9%
Taylor expanded in y around 0 38.2%
Final simplification38.2%
herbie shell --seed 2023240
(FPCore (x y z t)
:name "Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23"
:precision binary64
(+ (* (+ (* x y) z) y) t))