
(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-define99.9%
fma-define99.9%
Simplified99.9%
Final simplification99.9%
(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}
if y < -8.80000000000000042e55 or -6.2000000000000002e-46 < y < -7.19999999999999956e-56 or 3.00000000000000024e-76 < y Initial program 99.9%
Taylor expanded in x around inf 81.7%
+-commutative81.7%
distribute-lft-in81.7%
unpow281.7%
associate-*l*85.3%
associate-/l*84.6%
associate-*r*76.2%
distribute-lft-out97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in t around 0 79.4%
Taylor expanded in y around inf 70.9%
if -8.80000000000000042e55 < y < -6.2000000000000002e-46Initial program 99.9%
Taylor expanded in t around -inf 90.8%
mul-1-neg90.8%
distribute-rgt-neg-in90.8%
fma-neg90.8%
+-commutative90.8%
fma-undefine90.8%
*-commutative90.8%
associate-/l*90.8%
fma-undefine90.8%
*-commutative90.8%
fma-undefine90.8%
metadata-eval90.8%
Simplified90.8%
Taylor expanded in z around inf 49.6%
if -7.19999999999999956e-56 < y < 3.00000000000000024e-76Initial program 100.0%
Taylor expanded in y around 0 72.3%
Final simplification69.7%
(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}
if y < -7.6000000000000005e54 or -9.00000000000000081e-37 < y < -3.09999999999999987e-56Initial program 99.8%
Taylor expanded in x around inf 77.9%
+-commutative77.9%
distribute-lft-in77.9%
unpow277.9%
associate-*l*84.0%
associate-/l*82.5%
associate-*r*74.1%
distribute-lft-out98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in t around 0 84.7%
Taylor expanded in y around inf 76.3%
if -7.6000000000000005e54 < y < -9.00000000000000081e-37Initial program 99.9%
Taylor expanded in t around -inf 90.8%
mul-1-neg90.8%
distribute-rgt-neg-in90.8%
fma-neg90.8%
+-commutative90.8%
fma-undefine90.8%
*-commutative90.8%
associate-/l*90.8%
fma-undefine90.8%
*-commutative90.8%
fma-undefine90.8%
metadata-eval90.8%
Simplified90.8%
Taylor expanded in z around inf 49.6%
if -3.09999999999999987e-56 < y < 1.34999999999999997e-73Initial program 100.0%
Taylor expanded in y around 0 72.3%
if 1.34999999999999997e-73 < y Initial program 99.9%
Taylor expanded in t around -inf 89.6%
mul-1-neg89.6%
distribute-rgt-neg-in89.6%
fma-neg89.6%
+-commutative89.6%
fma-undefine89.6%
*-commutative89.6%
associate-/l*88.2%
fma-undefine88.2%
*-commutative88.2%
fma-undefine88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in t around 0 82.7%
Taylor expanded in z around 0 70.3%
*-commutative70.3%
Simplified70.3%
Final simplification70.8%
(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}
if y < -2.4000000000000001e24 or 2.5000000000000002e-6 < y Initial program 99.9%
Taylor expanded in t around -inf 91.7%
mul-1-neg91.7%
distribute-rgt-neg-in91.7%
fma-neg91.7%
+-commutative91.7%
fma-undefine91.7%
*-commutative91.7%
associate-/l*90.8%
fma-undefine90.8%
*-commutative90.8%
fma-undefine90.8%
metadata-eval90.8%
Simplified90.8%
Taylor expanded in t around 0 91.5%
if -2.4000000000000001e24 < y < 2.5000000000000002e-6Initial program 99.9%
Taylor expanded in x around 0 86.6%
Final simplification88.9%
(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}
if z < -1.79999999999999993e139 or 2.1000000000000002e63 < z Initial program 100.0%
Taylor expanded in x around 0 90.0%
if -1.79999999999999993e139 < z < 2.1000000000000002e63Initial program 99.9%
Taylor expanded in x around inf 92.0%
*-commutative92.0%
Simplified92.0%
Final simplification91.4%
(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}
if y < -5.39999999999999983e51Initial program 99.9%
Taylor expanded in x around inf 75.6%
+-commutative75.6%
distribute-lft-in75.6%
unpow275.6%
associate-*l*82.0%
associate-/l*82.0%
associate-*r*74.9%
distribute-lft-out99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 85.9%
Taylor expanded in y around inf 75.9%
if -5.39999999999999983e51 < y < 30500Initial program 99.9%
Taylor expanded in x around 0 85.9%
if 30500 < y Initial program 99.9%
Taylor expanded in t around -inf 90.0%
mul-1-neg90.0%
distribute-rgt-neg-in90.0%
fma-neg90.0%
+-commutative90.0%
fma-undefine90.0%
*-commutative90.0%
associate-/l*88.2%
fma-undefine88.2%
*-commutative88.2%
fma-undefine88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in t around 0 88.1%
Taylor expanded in z around 0 78.9%
*-commutative78.9%
Simplified78.9%
Final simplification82.0%
(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}
if z < -2.09999999999999997e129 or 7.599999999999999e81 < z Initial program 100.0%
Taylor expanded in t around -inf 89.6%
mul-1-neg89.6%
distribute-rgt-neg-in89.6%
fma-neg89.6%
+-commutative89.6%
fma-undefine89.6%
*-commutative89.6%
associate-/l*89.5%
fma-undefine89.5%
*-commutative89.5%
fma-undefine89.5%
metadata-eval89.5%
Simplified89.5%
Taylor expanded in z around inf 67.7%
if -2.09999999999999997e129 < z < 7.599999999999999e81Initial program 99.9%
Taylor expanded in y around 0 45.1%
Final simplification52.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 2024077
(FPCore (x y z t)
:name "Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23"
:precision binary64
(+ (* (+ (* x y) z) y) t))