
(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 8 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 (+ z (fma x 3.0 (* 2.0 y))))
double code(double x, double y, double z) {
return z + fma(x, 3.0, (2.0 * y));
}
function code(x, y, z) return Float64(z + fma(x, 3.0, Float64(2.0 * y))) end
code[x_, y_, z_] := N[(z + N[(x * 3.0 + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z + \mathsf{fma}\left(x, 3, 2 \cdot y\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
remove-double-neg99.9%
distribute-neg-in99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate--l+99.9%
count-299.9%
*-commutative99.9%
fma-def99.9%
count-299.9%
neg-mul-199.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
Simplified99.9%
add-log-exp27.7%
*-un-lft-identity27.7%
log-prod27.7%
metadata-eval27.7%
add-log-exp99.9%
fma-udef99.9%
+-commutative99.9%
fma-def99.9%
*-commutative99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= x -3.4e+63)
(* x 3.0)
(if (<= x -5.4e-13)
z
(if (<= x -3.3e-82)
(* 2.0 y)
(if (<= x -2e-178)
z
(if (<= x -3.7e-255)
(* 2.0 y)
(if (<= x 1.35e-6) z (if (<= x 1.9e+114) (* 2.0 y) (* x 3.0)))))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e+63) {
tmp = x * 3.0;
} else if (x <= -5.4e-13) {
tmp = z;
} else if (x <= -3.3e-82) {
tmp = 2.0 * y;
} else if (x <= -2e-178) {
tmp = z;
} else if (x <= -3.7e-255) {
tmp = 2.0 * y;
} else if (x <= 1.35e-6) {
tmp = z;
} else if (x <= 1.9e+114) {
tmp = 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 <= (-3.4d+63)) then
tmp = x * 3.0d0
else if (x <= (-5.4d-13)) then
tmp = z
else if (x <= (-3.3d-82)) then
tmp = 2.0d0 * y
else if (x <= (-2d-178)) then
tmp = z
else if (x <= (-3.7d-255)) then
tmp = 2.0d0 * y
else if (x <= 1.35d-6) then
tmp = z
else if (x <= 1.9d+114) then
tmp = 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 <= -3.4e+63) {
tmp = x * 3.0;
} else if (x <= -5.4e-13) {
tmp = z;
} else if (x <= -3.3e-82) {
tmp = 2.0 * y;
} else if (x <= -2e-178) {
tmp = z;
} else if (x <= -3.7e-255) {
tmp = 2.0 * y;
} else if (x <= 1.35e-6) {
tmp = z;
} else if (x <= 1.9e+114) {
tmp = 2.0 * y;
} else {
tmp = x * 3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.4e+63: tmp = x * 3.0 elif x <= -5.4e-13: tmp = z elif x <= -3.3e-82: tmp = 2.0 * y elif x <= -2e-178: tmp = z elif x <= -3.7e-255: tmp = 2.0 * y elif x <= 1.35e-6: tmp = z elif x <= 1.9e+114: tmp = 2.0 * y else: tmp = x * 3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.4e+63) tmp = Float64(x * 3.0); elseif (x <= -5.4e-13) tmp = z; elseif (x <= -3.3e-82) tmp = Float64(2.0 * y); elseif (x <= -2e-178) tmp = z; elseif (x <= -3.7e-255) tmp = Float64(2.0 * y); elseif (x <= 1.35e-6) tmp = z; elseif (x <= 1.9e+114) tmp = 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 <= -3.4e+63) tmp = x * 3.0; elseif (x <= -5.4e-13) tmp = z; elseif (x <= -3.3e-82) tmp = 2.0 * y; elseif (x <= -2e-178) tmp = z; elseif (x <= -3.7e-255) tmp = 2.0 * y; elseif (x <= 1.35e-6) tmp = z; elseif (x <= 1.9e+114) tmp = 2.0 * y; else tmp = x * 3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.4e+63], N[(x * 3.0), $MachinePrecision], If[LessEqual[x, -5.4e-13], z, If[LessEqual[x, -3.3e-82], N[(2.0 * y), $MachinePrecision], If[LessEqual[x, -2e-178], z, If[LessEqual[x, -3.7e-255], N[(2.0 * y), $MachinePrecision], If[LessEqual[x, 1.35e-6], z, If[LessEqual[x, 1.9e+114], N[(2.0 * y), $MachinePrecision], N[(x * 3.0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+63}:\\
\;\;\;\;x \cdot 3\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{-13}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-82}:\\
\;\;\;\;2 \cdot y\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-178}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-255}:\\
\;\;\;\;2 \cdot y\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-6}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+114}:\\
\;\;\;\;2 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot 3\\
\end{array}
\end{array}
if x < -3.3999999999999999e63 or 1.9e114 < x Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
count-299.7%
Simplified99.7%
Taylor expanded in x around inf 74.6%
if -3.3999999999999999e63 < x < -5.40000000000000021e-13 or -3.30000000000000022e-82 < x < -1.9999999999999999e-178 or -3.7000000000000002e-255 < x < 1.34999999999999999e-6Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in z around inf 63.6%
if -5.40000000000000021e-13 < x < -3.30000000000000022e-82 or -1.9999999999999999e-178 < x < -3.7000000000000002e-255 or 1.34999999999999999e-6 < x < 1.9e114Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 64.4%
Final simplification67.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ z (* x 3.0))))
(if (<= x -2.4e+18)
t_0
(if (<= x 5.2e+31)
(+ z (* 2.0 y))
(if (<= x 2.6e+155) (+ x (* 2.0 (+ x y))) t_0)))))
double code(double x, double y, double z) {
double t_0 = z + (x * 3.0);
double tmp;
if (x <= -2.4e+18) {
tmp = t_0;
} else if (x <= 5.2e+31) {
tmp = z + (2.0 * y);
} else if (x <= 2.6e+155) {
tmp = x + (2.0 * (x + y));
} 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 = z + (x * 3.0d0)
if (x <= (-2.4d+18)) then
tmp = t_0
else if (x <= 5.2d+31) then
tmp = z + (2.0d0 * y)
else if (x <= 2.6d+155) then
tmp = x + (2.0d0 * (x + y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z + (x * 3.0);
double tmp;
if (x <= -2.4e+18) {
tmp = t_0;
} else if (x <= 5.2e+31) {
tmp = z + (2.0 * y);
} else if (x <= 2.6e+155) {
tmp = x + (2.0 * (x + y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z + (x * 3.0) tmp = 0 if x <= -2.4e+18: tmp = t_0 elif x <= 5.2e+31: tmp = z + (2.0 * y) elif x <= 2.6e+155: tmp = x + (2.0 * (x + y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z + Float64(x * 3.0)) tmp = 0.0 if (x <= -2.4e+18) tmp = t_0; elseif (x <= 5.2e+31) tmp = Float64(z + Float64(2.0 * y)); elseif (x <= 2.6e+155) tmp = Float64(x + Float64(2.0 * Float64(x + y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z + (x * 3.0); tmp = 0.0; if (x <= -2.4e+18) tmp = t_0; elseif (x <= 5.2e+31) tmp = z + (2.0 * y); elseif (x <= 2.6e+155) tmp = x + (2.0 * (x + y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z + N[(x * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.4e+18], t$95$0, If[LessEqual[x, 5.2e+31], N[(z + N[(2.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e+155], N[(x + N[(2.0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z + x \cdot 3\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+31}:\\
\;\;\;\;z + 2 \cdot y\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+155}:\\
\;\;\;\;x + 2 \cdot \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -2.4e18 or 2.6000000000000002e155 < x Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
remove-double-neg99.7%
distribute-neg-in99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
sub-neg99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.8%
associate--l+99.7%
count-299.7%
*-commutative99.7%
fma-def99.7%
count-299.7%
neg-mul-199.7%
distribute-rgt-out--99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 91.9%
if -2.4e18 < x < 5.2e31Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around 0 94.3%
if 5.2e31 < x < 2.6000000000000002e155Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in z around 0 95.2%
Final simplification93.6%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.16e+18) (not (<= x 1.62e+109))) (+ z (* x 3.0)) (+ z (* 2.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.16e+18) || !(x <= 1.62e+109)) {
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 <= (-1.16d+18)) .or. (.not. (x <= 1.62d+109))) 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 <= -1.16e+18) || !(x <= 1.62e+109)) {
tmp = z + (x * 3.0);
} else {
tmp = z + (2.0 * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.16e+18) or not (x <= 1.62e+109): tmp = z + (x * 3.0) else: tmp = z + (2.0 * y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.16e+18) || !(x <= 1.62e+109)) 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 <= -1.16e+18) || ~((x <= 1.62e+109))) tmp = z + (x * 3.0); else tmp = z + (2.0 * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.16e+18], N[Not[LessEqual[x, 1.62e+109]], $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 -1.16 \cdot 10^{+18} \lor \neg \left(x \leq 1.62 \cdot 10^{+109}\right):\\
\;\;\;\;z + x \cdot 3\\
\mathbf{else}:\\
\;\;\;\;z + 2 \cdot y\\
\end{array}
\end{array}
if x < -1.16e18 or 1.62e109 < x Initial program 99.7%
+-commutative99.7%
associate-+l+99.8%
remove-double-neg99.8%
distribute-neg-in99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.8%
associate--l+99.8%
count-299.8%
*-commutative99.8%
fma-def99.8%
count-299.8%
neg-mul-199.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 90.4%
if -1.16e18 < x < 1.62e109Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around 0 92.4%
Final simplification91.6%
(FPCore (x y z) :precision binary64 (if (<= x -3.5e+92) (* x 3.0) (if (<= x 2.3e+114) (+ z (* 2.0 y)) (* x 3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e+92) {
tmp = x * 3.0;
} else if (x <= 2.3e+114) {
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 <= (-3.5d+92)) then
tmp = x * 3.0d0
else if (x <= 2.3d+114) 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 <= -3.5e+92) {
tmp = x * 3.0;
} else if (x <= 2.3e+114) {
tmp = z + (2.0 * y);
} else {
tmp = x * 3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.5e+92: tmp = x * 3.0 elif x <= 2.3e+114: tmp = z + (2.0 * y) else: tmp = x * 3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.5e+92) tmp = Float64(x * 3.0); elseif (x <= 2.3e+114) 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 <= -3.5e+92) tmp = x * 3.0; elseif (x <= 2.3e+114) tmp = z + (2.0 * y); else tmp = x * 3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.5e+92], N[(x * 3.0), $MachinePrecision], If[LessEqual[x, 2.3e+114], N[(z + N[(2.0 * y), $MachinePrecision]), $MachinePrecision], N[(x * 3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+92}:\\
\;\;\;\;x \cdot 3\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+114}:\\
\;\;\;\;z + 2 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot 3\\
\end{array}
\end{array}
if x < -3.49999999999999986e92 or 2.3e114 < x Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
count-299.7%
Simplified99.7%
Taylor expanded in x around inf 76.7%
if -3.49999999999999986e92 < x < 2.3e114Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around 0 89.6%
Final simplification85.1%
(FPCore (x y z) :precision binary64 (+ x (+ z (* 2.0 (+ x y)))))
double code(double x, double y, double z) {
return x + (z + (2.0 * (x + y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (z + (2.0d0 * (x + y)))
end function
public static double code(double x, double y, double z) {
return x + (z + (2.0 * (x + y)));
}
def code(x, y, z): return x + (z + (2.0 * (x + y)))
function code(x, y, z) return Float64(x + Float64(z + Float64(2.0 * Float64(x + y)))) end
function tmp = code(x, y, z) tmp = x + (z + (2.0 * (x + y))); end
code[x_, y_, z_] := N[(x + N[(z + N[(2.0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z + 2 \cdot \left(x + y\right)\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 (if (<= y -5.6e+54) (* 2.0 y) (if (<= y 1.85e-13) z (* 2.0 y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.6e+54) {
tmp = 2.0 * y;
} else if (y <= 1.85e-13) {
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 <= (-5.6d+54)) then
tmp = 2.0d0 * y
else if (y <= 1.85d-13) 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 <= -5.6e+54) {
tmp = 2.0 * y;
} else if (y <= 1.85e-13) {
tmp = z;
} else {
tmp = 2.0 * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.6e+54: tmp = 2.0 * y elif y <= 1.85e-13: tmp = z else: tmp = 2.0 * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.6e+54) tmp = Float64(2.0 * y); elseif (y <= 1.85e-13) tmp = z; else tmp = Float64(2.0 * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.6e+54) tmp = 2.0 * y; elseif (y <= 1.85e-13) tmp = z; else tmp = 2.0 * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.6e+54], N[(2.0 * y), $MachinePrecision], If[LessEqual[y, 1.85e-13], z, N[(2.0 * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+54}:\\
\;\;\;\;2 \cdot y\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-13}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;2 \cdot y\\
\end{array}
\end{array}
if y < -5.6000000000000003e54 or 1.84999999999999994e-13 < y Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 60.5%
if -5.6000000000000003e54 < y < 1.84999999999999994e-13Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in z around inf 53.5%
Final simplification56.5%
(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 37.6%
Final simplification37.6%
herbie shell --seed 2023268
(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))