
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
double code(double x, double y, double z) {
return ((((x + y) + y) + x) + z) + x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x + y) + y) + x) + z) + x
end function
public static double code(double x, double y, double z) {
return ((((x + y) + y) + x) + z) + x;
}
def code(x, y, z): return ((((x + y) + y) + x) + z) + x
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x + y) + y) + x) + z) + x) end
function tmp = code(x, y, z) tmp = ((((x + y) + y) + x) + z) + x; end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
double code(double x, double y, double z) {
return ((((x + y) + y) + x) + z) + x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x + y) + y) + x) + z) + x
end function
public static double code(double x, double y, double z) {
return ((((x + y) + y) + x) + z) + x;
}
def code(x, y, z): return ((((x + y) + y) + x) + z) + x
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x + y) + y) + x) + z) + x) end
function tmp = code(x, y, z) tmp = ((((x + y) + y) + x) + z) + x; end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
\end{array}
(FPCore (x y z) :precision binary64 (+ x (+ (* 2.0 (+ x y)) z)))
double code(double x, double y, double z) {
return x + ((2.0 * (x + y)) + z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((2.0d0 * (x + y)) + z)
end function
public static double code(double x, double y, double z) {
return x + ((2.0 * (x + y)) + z);
}
def code(x, y, z): return x + ((2.0 * (x + y)) + z)
function code(x, y, z) return Float64(x + Float64(Float64(2.0 * Float64(x + y)) + z)) end
function tmp = code(x, y, z) tmp = x + ((2.0 * (x + y)) + z); end
code[x_, y_, z_] := N[(x + N[(N[(2.0 * N[(x + y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(2 \cdot \left(x + y\right) + z\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* 2.0 y))))
(if (<= y -10500000000000.0)
t_0
(if (<= y -5.4e-274)
z
(if (<= y 7.2e-88) (* x 3.0) (if (<= y 9.8e+92) z t_0))))))
double code(double x, double y, double z) {
double t_0 = x + (2.0 * y);
double tmp;
if (y <= -10500000000000.0) {
tmp = t_0;
} else if (y <= -5.4e-274) {
tmp = z;
} else if (y <= 7.2e-88) {
tmp = x * 3.0;
} else if (y <= 9.8e+92) {
tmp = z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x + (2.0d0 * y)
if (y <= (-10500000000000.0d0)) then
tmp = t_0
else if (y <= (-5.4d-274)) then
tmp = z
else if (y <= 7.2d-88) then
tmp = x * 3.0d0
else if (y <= 9.8d+92) then
tmp = z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (2.0 * y);
double tmp;
if (y <= -10500000000000.0) {
tmp = t_0;
} else if (y <= -5.4e-274) {
tmp = z;
} else if (y <= 7.2e-88) {
tmp = x * 3.0;
} else if (y <= 9.8e+92) {
tmp = z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (2.0 * y) tmp = 0 if y <= -10500000000000.0: tmp = t_0 elif y <= -5.4e-274: tmp = z elif y <= 7.2e-88: tmp = x * 3.0 elif y <= 9.8e+92: tmp = z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(2.0 * y)) tmp = 0.0 if (y <= -10500000000000.0) tmp = t_0; elseif (y <= -5.4e-274) tmp = z; elseif (y <= 7.2e-88) tmp = Float64(x * 3.0); elseif (y <= 9.8e+92) tmp = z; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (2.0 * y); tmp = 0.0; if (y <= -10500000000000.0) tmp = t_0; elseif (y <= -5.4e-274) tmp = z; elseif (y <= 7.2e-88) tmp = x * 3.0; elseif (y <= 9.8e+92) tmp = z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -10500000000000.0], t$95$0, If[LessEqual[y, -5.4e-274], z, If[LessEqual[y, 7.2e-88], N[(x * 3.0), $MachinePrecision], If[LessEqual[y, 9.8e+92], z, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + 2 \cdot y\\
\mathbf{if}\;y \leq -10500000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -5.4 \cdot 10^{-274}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-88}:\\
\;\;\;\;x \cdot 3\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{+92}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.05e13 or 9.8000000000000003e92 < y Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
+-commutative100.0%
flip-+25.8%
div-inv25.8%
fma-def25.8%
pow225.8%
fma-neg25.8%
Applied egg-rr25.8%
fma-udef25.8%
+-commutative25.8%
associate-*r/25.8%
*-rgt-identity25.8%
+-commutative25.8%
fma-neg25.8%
+-commutative25.8%
Simplified25.8%
Taylor expanded in y around inf 70.1%
*-commutative70.1%
Simplified70.1%
if -1.05e13 < y < -5.400000000000001e-274 or 7.1999999999999999e-88 < y < 9.8000000000000003e92Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in z around inf 56.0%
if -5.400000000000001e-274 < y < 7.1999999999999999e-88Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in x around inf 59.0%
Final simplification62.7%
(FPCore (x y z)
:precision binary64
(if (<= y -12600000000000.0)
(* 2.0 y)
(if (<= y -1.8e-273)
z
(if (<= y 3e-88) (* x 3.0) (if (<= y 3.2e+93) z (* 2.0 y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -12600000000000.0) {
tmp = 2.0 * y;
} else if (y <= -1.8e-273) {
tmp = z;
} else if (y <= 3e-88) {
tmp = x * 3.0;
} else if (y <= 3.2e+93) {
tmp = z;
} else {
tmp = 2.0 * y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-12600000000000.0d0)) then
tmp = 2.0d0 * y
else if (y <= (-1.8d-273)) then
tmp = z
else if (y <= 3d-88) then
tmp = x * 3.0d0
else if (y <= 3.2d+93) then
tmp = z
else
tmp = 2.0d0 * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -12600000000000.0) {
tmp = 2.0 * y;
} else if (y <= -1.8e-273) {
tmp = z;
} else if (y <= 3e-88) {
tmp = x * 3.0;
} else if (y <= 3.2e+93) {
tmp = z;
} else {
tmp = 2.0 * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -12600000000000.0: tmp = 2.0 * y elif y <= -1.8e-273: tmp = z elif y <= 3e-88: tmp = x * 3.0 elif y <= 3.2e+93: tmp = z else: tmp = 2.0 * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -12600000000000.0) tmp = Float64(2.0 * y); elseif (y <= -1.8e-273) tmp = z; elseif (y <= 3e-88) tmp = Float64(x * 3.0); elseif (y <= 3.2e+93) tmp = z; else tmp = Float64(2.0 * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -12600000000000.0) tmp = 2.0 * y; elseif (y <= -1.8e-273) tmp = z; elseif (y <= 3e-88) tmp = x * 3.0; elseif (y <= 3.2e+93) tmp = z; else tmp = 2.0 * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -12600000000000.0], N[(2.0 * y), $MachinePrecision], If[LessEqual[y, -1.8e-273], z, If[LessEqual[y, 3e-88], N[(x * 3.0), $MachinePrecision], If[LessEqual[y, 3.2e+93], z, N[(2.0 * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -12600000000000:\\
\;\;\;\;2 \cdot y\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-273}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-88}:\\
\;\;\;\;x \cdot 3\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+93}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;2 \cdot y\\
\end{array}
\end{array}
if y < -1.26e13 or 3.2000000000000001e93 < y Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 68.0%
if -1.26e13 < y < -1.79999999999999996e-273 or 2.9999999999999999e-88 < y < 3.2000000000000001e93Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in z around inf 56.0%
if -1.79999999999999996e-273 < y < 2.9999999999999999e-88Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in x around inf 59.0%
Final simplification61.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -8e+50) (not (<= x 8e+53))) (+ x (* 2.0 (+ x y))) (+ z (* 2.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -8e+50) || !(x <= 8e+53)) {
tmp = x + (2.0 * (x + y));
} else {
tmp = z + (2.0 * y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-8d+50)) .or. (.not. (x <= 8d+53))) then
tmp = x + (2.0d0 * (x + y))
else
tmp = z + (2.0d0 * y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -8e+50) || !(x <= 8e+53)) {
tmp = x + (2.0 * (x + y));
} else {
tmp = z + (2.0 * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -8e+50) or not (x <= 8e+53): tmp = x + (2.0 * (x + y)) else: tmp = z + (2.0 * y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -8e+50) || !(x <= 8e+53)) tmp = Float64(x + Float64(2.0 * Float64(x + y))); else tmp = Float64(z + Float64(2.0 * y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -8e+50) || ~((x <= 8e+53))) tmp = x + (2.0 * (x + y)); else tmp = z + (2.0 * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -8e+50], N[Not[LessEqual[x, 8e+53]], $MachinePrecision]], N[(x + N[(2.0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+50} \lor \neg \left(x \leq 8 \cdot 10^{+53}\right):\\
\;\;\;\;x + 2 \cdot \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;z + 2 \cdot y\\
\end{array}
\end{array}
if x < -8.0000000000000006e50 or 7.9999999999999999e53 < x Initial program 99.8%
+-commutative99.8%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in z around 0 86.0%
+-commutative86.0%
Simplified86.0%
if -8.0000000000000006e50 < x < 7.9999999999999999e53Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around 0 94.6%
Final simplification91.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -4.8e+50) (not (<= x 9.5e+56))) (+ z (* x 3.0)) (+ z (* 2.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -4.8e+50) || !(x <= 9.5e+56)) {
tmp = z + (x * 3.0);
} else {
tmp = z + (2.0 * y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-4.8d+50)) .or. (.not. (x <= 9.5d+56))) then
tmp = z + (x * 3.0d0)
else
tmp = z + (2.0d0 * y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -4.8e+50) || !(x <= 9.5e+56)) {
tmp = z + (x * 3.0);
} else {
tmp = z + (2.0 * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -4.8e+50) or not (x <= 9.5e+56): tmp = z + (x * 3.0) else: tmp = z + (2.0 * y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -4.8e+50) || !(x <= 9.5e+56)) tmp = Float64(z + Float64(x * 3.0)); else tmp = Float64(z + Float64(2.0 * y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -4.8e+50) || ~((x <= 9.5e+56))) tmp = z + (x * 3.0); else tmp = z + (2.0 * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -4.8e+50], N[Not[LessEqual[x, 9.5e+56]], $MachinePrecision]], N[(z + N[(x * 3.0), $MachinePrecision]), $MachinePrecision], N[(z + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+50} \lor \neg \left(x \leq 9.5 \cdot 10^{+56}\right):\\
\;\;\;\;z + x \cdot 3\\
\mathbf{else}:\\
\;\;\;\;z + 2 \cdot y\\
\end{array}
\end{array}
if x < -4.8000000000000004e50 or 9.4999999999999997e56 < x Initial program 99.8%
+-commutative99.8%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around 0 76.0%
+-commutative76.0%
*-commutative76.0%
associate-+l+76.0%
*-commutative76.0%
distribute-lft1-in76.0%
metadata-eval76.0%
Simplified76.0%
if -4.8000000000000004e50 < x < 9.4999999999999997e56Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around 0 94.1%
Final simplification87.4%
(FPCore (x y z) :precision binary64 (if (<= x -1.95e+101) (* x 3.0) (if (<= x 1.5e+177) (+ z (* 2.0 y)) (* x 3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.95e+101) {
tmp = x * 3.0;
} else if (x <= 1.5e+177) {
tmp = z + (2.0 * y);
} else {
tmp = x * 3.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.95d+101)) then
tmp = x * 3.0d0
else if (x <= 1.5d+177) then
tmp = z + (2.0d0 * y)
else
tmp = x * 3.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.95e+101) {
tmp = x * 3.0;
} else if (x <= 1.5e+177) {
tmp = z + (2.0 * y);
} else {
tmp = x * 3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.95e+101: tmp = x * 3.0 elif x <= 1.5e+177: tmp = z + (2.0 * y) else: tmp = x * 3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.95e+101) tmp = Float64(x * 3.0); elseif (x <= 1.5e+177) tmp = Float64(z + Float64(2.0 * y)); else tmp = Float64(x * 3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.95e+101) tmp = x * 3.0; elseif (x <= 1.5e+177) tmp = z + (2.0 * y); else tmp = x * 3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.95e+101], N[(x * 3.0), $MachinePrecision], If[LessEqual[x, 1.5e+177], N[(z + N[(2.0 * y), $MachinePrecision]), $MachinePrecision], N[(x * 3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+101}:\\
\;\;\;\;x \cdot 3\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+177}:\\
\;\;\;\;z + 2 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot 3\\
\end{array}
\end{array}
if x < -1.95e101 or 1.5e177 < x Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in x around inf 75.2%
if -1.95e101 < x < 1.5e177Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around 0 87.0%
Final simplification84.3%
(FPCore (x y z) :precision binary64 (if (<= y -18000000000000.0) (* 2.0 y) (if (<= y 9.8e+92) z (* 2.0 y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -18000000000000.0) {
tmp = 2.0 * y;
} else if (y <= 9.8e+92) {
tmp = z;
} else {
tmp = 2.0 * y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-18000000000000.0d0)) then
tmp = 2.0d0 * y
else if (y <= 9.8d+92) then
tmp = z
else
tmp = 2.0d0 * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -18000000000000.0) {
tmp = 2.0 * y;
} else if (y <= 9.8e+92) {
tmp = z;
} else {
tmp = 2.0 * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -18000000000000.0: tmp = 2.0 * y elif y <= 9.8e+92: tmp = z else: tmp = 2.0 * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -18000000000000.0) tmp = Float64(2.0 * y); elseif (y <= 9.8e+92) tmp = z; else tmp = Float64(2.0 * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -18000000000000.0) tmp = 2.0 * y; elseif (y <= 9.8e+92) tmp = z; else tmp = 2.0 * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -18000000000000.0], N[(2.0 * y), $MachinePrecision], If[LessEqual[y, 9.8e+92], z, N[(2.0 * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -18000000000000:\\
\;\;\;\;2 \cdot y\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{+92}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;2 \cdot y\\
\end{array}
\end{array}
if y < -1.8e13 or 9.8000000000000003e92 < y Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 68.0%
if -1.8e13 < y < 9.8000000000000003e92Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in z around inf 49.7%
Final simplification57.6%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
+-commutative99.9%
associate-+l+99.9%
*-commutative99.9%
add-cube-cbrt98.9%
associate-*l*98.9%
fma-def98.8%
pow298.8%
Applied egg-rr98.8%
Taylor expanded in x around inf 7.1%
Final simplification7.1%
(FPCore (x y z) :precision binary64 z)
double code(double x, double y, double z) {
return z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z
end function
public static double code(double x, double y, double z) {
return z;
}
def code(x, y, z): return z
function code(x, y, z) return z end
function tmp = code(x, y, z) tmp = z; end
code[x_, y_, z_] := z
\begin{array}{l}
\\
z
\end{array}
Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in z around inf 35.7%
Final simplification35.7%
herbie shell --seed 2023290
(FPCore (x y z)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendInside from plot-0.2.3.4"
:precision binary64
(+ (+ (+ (+ (+ x y) y) x) z) x))