
(FPCore (x y z) :precision binary64 (+ (+ (/ x 2.0) (* y x)) z))
double code(double x, double y, double z) {
return ((x / 2.0) + (y * x)) + 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) + (y * x)) + z
end function
public static double code(double x, double y, double z) {
return ((x / 2.0) + (y * x)) + z;
}
def code(x, y, z): return ((x / 2.0) + (y * x)) + z
function code(x, y, z) return Float64(Float64(Float64(x / 2.0) + Float64(y * x)) + z) end
function tmp = code(x, y, z) tmp = ((x / 2.0) + (y * x)) + z; end
code[x_, y_, z_] := N[(N[(N[(x / 2.0), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{x}{2} + y \cdot x\right) + z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (+ (/ x 2.0) (* y x)) z))
double code(double x, double y, double z) {
return ((x / 2.0) + (y * x)) + 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) + (y * x)) + z
end function
public static double code(double x, double y, double z) {
return ((x / 2.0) + (y * x)) + z;
}
def code(x, y, z): return ((x / 2.0) + (y * x)) + z
function code(x, y, z) return Float64(Float64(Float64(x / 2.0) + Float64(y * x)) + z) end
function tmp = code(x, y, z) tmp = ((x / 2.0) + (y * x)) + z; end
code[x_, y_, z_] := N[(N[(N[(x / 2.0), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{x}{2} + y \cdot x\right) + z
\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(Float64(Float64(x / 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[(N[(N[(x / 2.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{x}{2} + x \cdot y\right) + z
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(if (<= y -8500000.0)
(* x y)
(if (<= y -1.08e-187)
z
(if (<= y -5.6e-225)
(* x 0.5)
(if (<= y -2.8e-265)
z
(if (<= y 3.1e-232)
(* x 0.5)
(if (<= y 8.6e-138)
z
(if (<= y 7.5e-47) (* x 0.5) (if (<= y 3e+51) z (* x y))))))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -8500000.0) {
tmp = x * y;
} else if (y <= -1.08e-187) {
tmp = z;
} else if (y <= -5.6e-225) {
tmp = x * 0.5;
} else if (y <= -2.8e-265) {
tmp = z;
} else if (y <= 3.1e-232) {
tmp = x * 0.5;
} else if (y <= 8.6e-138) {
tmp = z;
} else if (y <= 7.5e-47) {
tmp = x * 0.5;
} else if (y <= 3e+51) {
tmp = z;
} else {
tmp = x * 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 <= (-8500000.0d0)) then
tmp = x * y
else if (y <= (-1.08d-187)) then
tmp = z
else if (y <= (-5.6d-225)) then
tmp = x * 0.5d0
else if (y <= (-2.8d-265)) then
tmp = z
else if (y <= 3.1d-232) then
tmp = x * 0.5d0
else if (y <= 8.6d-138) then
tmp = z
else if (y <= 7.5d-47) then
tmp = x * 0.5d0
else if (y <= 3d+51) then
tmp = z
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -8500000.0) {
tmp = x * y;
} else if (y <= -1.08e-187) {
tmp = z;
} else if (y <= -5.6e-225) {
tmp = x * 0.5;
} else if (y <= -2.8e-265) {
tmp = z;
} else if (y <= 3.1e-232) {
tmp = x * 0.5;
} else if (y <= 8.6e-138) {
tmp = z;
} else if (y <= 7.5e-47) {
tmp = x * 0.5;
} else if (y <= 3e+51) {
tmp = z;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -8500000.0: tmp = x * y elif y <= -1.08e-187: tmp = z elif y <= -5.6e-225: tmp = x * 0.5 elif y <= -2.8e-265: tmp = z elif y <= 3.1e-232: tmp = x * 0.5 elif y <= 8.6e-138: tmp = z elif y <= 7.5e-47: tmp = x * 0.5 elif y <= 3e+51: tmp = z else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -8500000.0) tmp = Float64(x * y); elseif (y <= -1.08e-187) tmp = z; elseif (y <= -5.6e-225) tmp = Float64(x * 0.5); elseif (y <= -2.8e-265) tmp = z; elseif (y <= 3.1e-232) tmp = Float64(x * 0.5); elseif (y <= 8.6e-138) tmp = z; elseif (y <= 7.5e-47) tmp = Float64(x * 0.5); elseif (y <= 3e+51) tmp = z; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -8500000.0) tmp = x * y; elseif (y <= -1.08e-187) tmp = z; elseif (y <= -5.6e-225) tmp = x * 0.5; elseif (y <= -2.8e-265) tmp = z; elseif (y <= 3.1e-232) tmp = x * 0.5; elseif (y <= 8.6e-138) tmp = z; elseif (y <= 7.5e-47) tmp = x * 0.5; elseif (y <= 3e+51) tmp = z; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -8500000.0], N[(x * y), $MachinePrecision], If[LessEqual[y, -1.08e-187], z, If[LessEqual[y, -5.6e-225], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, -2.8e-265], z, If[LessEqual[y, 3.1e-232], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 8.6e-138], z, If[LessEqual[y, 7.5e-47], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 3e+51], z, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8500000:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -1.08 \cdot 10^{-187}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-225}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-265}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-232}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{-138}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-47}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+51}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -8.5e6 or 3e51 < y Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 77.2%
+-commutative77.2%
Simplified77.2%
Taylor expanded in y around inf 76.6%
if -8.5e6 < y < -1.08e-187 or -5.6e-225 < y < -2.80000000000000023e-265 or 3.0999999999999999e-232 < y < 8.6000000000000001e-138 or 7.49999999999999969e-47 < y < 3e51Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-neg-in100.0%
distribute-frac-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
neg-mul-1100.0%
associate-/l*99.9%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 72.4%
mul-1-neg72.4%
distribute-rgt-neg-out72.4%
Simplified72.4%
Taylor expanded in z around inf 68.3%
if -1.08e-187 < y < -5.6e-225 or -2.80000000000000023e-265 < y < 3.0999999999999999e-232 or 8.6000000000000001e-138 < y < 7.49999999999999969e-47Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 75.5%
+-commutative75.5%
Simplified75.5%
Taylor expanded in y around 0 75.5%
*-commutative75.5%
Simplified75.5%
Final simplification73.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -6.8e+187) (not (<= x 1100000000.0))) (* x (+ y 0.5)) (+ z (* x y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6.8e+187) || !(x <= 1100000000.0)) {
tmp = x * (y + 0.5);
} else {
tmp = z + (x * 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 <= (-6.8d+187)) .or. (.not. (x <= 1100000000.0d0))) then
tmp = x * (y + 0.5d0)
else
tmp = z + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -6.8e+187) || !(x <= 1100000000.0)) {
tmp = x * (y + 0.5);
} else {
tmp = z + (x * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6.8e+187) or not (x <= 1100000000.0): tmp = x * (y + 0.5) else: tmp = z + (x * y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6.8e+187) || !(x <= 1100000000.0)) tmp = Float64(x * Float64(y + 0.5)); else tmp = Float64(z + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -6.8e+187) || ~((x <= 1100000000.0))) tmp = x * (y + 0.5); else tmp = z + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6.8e+187], N[Not[LessEqual[x, 1100000000.0]], $MachinePrecision]], N[(x * N[(y + 0.5), $MachinePrecision]), $MachinePrecision], N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+187} \lor \neg \left(x \leq 1100000000\right):\\
\;\;\;\;x \cdot \left(y + 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z + x \cdot y\\
\end{array}
\end{array}
if x < -6.7999999999999999e187 or 1.1e9 < x Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 92.6%
+-commutative92.6%
Simplified92.6%
if -6.7999999999999999e187 < x < 1.1e9Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-neg-in100.0%
distribute-frac-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
neg-mul-1100.0%
associate-/l*100.0%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 87.3%
mul-1-neg87.3%
distribute-rgt-neg-out87.3%
Simplified87.3%
*-commutative87.3%
cancel-sign-sub87.3%
*-commutative87.3%
+-commutative87.3%
Applied egg-rr87.3%
Final simplification89.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.9) (not (<= y 0.5))) (+ z (* x y)) (- z (* x -0.5))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.9) || !(y <= 0.5)) {
tmp = z + (x * y);
} else {
tmp = z - (x * -0.5);
}
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 <= (-3.9d0)) .or. (.not. (y <= 0.5d0))) then
tmp = z + (x * y)
else
tmp = z - (x * (-0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3.9) || !(y <= 0.5)) {
tmp = z + (x * y);
} else {
tmp = z - (x * -0.5);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.9) or not (y <= 0.5): tmp = z + (x * y) else: tmp = z - (x * -0.5) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.9) || !(y <= 0.5)) tmp = Float64(z + Float64(x * y)); else tmp = Float64(z - Float64(x * -0.5)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.9) || ~((y <= 0.5))) tmp = z + (x * y); else tmp = z - (x * -0.5); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.9], N[Not[LessEqual[y, 0.5]], $MachinePrecision]], N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(z - N[(x * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \lor \neg \left(y \leq 0.5\right):\\
\;\;\;\;z + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z - x \cdot -0.5\\
\end{array}
\end{array}
if y < -3.89999999999999991 or 0.5 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-neg-in100.0%
distribute-frac-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
neg-mul-1100.0%
associate-/l*100.0%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 99.0%
mul-1-neg99.0%
distribute-rgt-neg-out99.0%
Simplified99.0%
*-commutative99.0%
cancel-sign-sub99.0%
*-commutative99.0%
+-commutative99.0%
Applied egg-rr99.0%
if -3.89999999999999991 < y < 0.5Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-neg-in100.0%
distribute-frac-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
neg-mul-1100.0%
associate-/l*99.9%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 99.3%
*-commutative99.3%
Simplified99.3%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (<= z -8e+49) z (if (<= z 2.3e+113) (* x (+ y 0.5)) z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -8e+49) {
tmp = z;
} else if (z <= 2.3e+113) {
tmp = x * (y + 0.5);
} else {
tmp = z;
}
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 (z <= (-8d+49)) then
tmp = z
else if (z <= 2.3d+113) then
tmp = x * (y + 0.5d0)
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -8e+49) {
tmp = z;
} else if (z <= 2.3e+113) {
tmp = x * (y + 0.5);
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -8e+49: tmp = z elif z <= 2.3e+113: tmp = x * (y + 0.5) else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -8e+49) tmp = z; elseif (z <= 2.3e+113) tmp = Float64(x * Float64(y + 0.5)); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -8e+49) tmp = z; elseif (z <= 2.3e+113) tmp = x * (y + 0.5); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -8e+49], z, If[LessEqual[z, 2.3e+113], N[(x * N[(y + 0.5), $MachinePrecision]), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+49}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+113}:\\
\;\;\;\;x \cdot \left(y + 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -7.99999999999999957e49 or 2.29999999999999997e113 < z Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-neg-in100.0%
distribute-frac-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
neg-mul-1100.0%
associate-/l*100.0%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 92.2%
mul-1-neg92.2%
distribute-rgt-neg-out92.2%
Simplified92.2%
Taylor expanded in z around inf 74.3%
if -7.99999999999999957e49 < z < 2.29999999999999997e113Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 80.1%
+-commutative80.1%
Simplified80.1%
Final simplification78.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.12e+174) (not (<= x 3.65e+22))) (* x 0.5) z))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.12e+174) || !(x <= 3.65e+22)) {
tmp = x * 0.5;
} else {
tmp = z;
}
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.12d+174)) .or. (.not. (x <= 3.65d+22))) then
tmp = x * 0.5d0
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.12e+174) || !(x <= 3.65e+22)) {
tmp = x * 0.5;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.12e+174) or not (x <= 3.65e+22): tmp = x * 0.5 else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.12e+174) || !(x <= 3.65e+22)) tmp = Float64(x * 0.5); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.12e+174) || ~((x <= 3.65e+22))) tmp = x * 0.5; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.12e+174], N[Not[LessEqual[x, 3.65e+22]], $MachinePrecision]], N[(x * 0.5), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{+174} \lor \neg \left(x \leq 3.65 \cdot 10^{+22}\right):\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.11999999999999993e174 or 3.6499999999999999e22 < x Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in y around 0 45.1%
*-commutative45.1%
Simplified45.1%
if -1.11999999999999993e174 < x < 3.6499999999999999e22Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-neg-in100.0%
distribute-frac-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
neg-mul-1100.0%
associate-/l*100.0%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 87.0%
mul-1-neg87.0%
distribute-rgt-neg-out87.0%
Simplified87.0%
Taylor expanded in z around inf 58.5%
Final simplification53.4%
(FPCore (x y z) :precision binary64 (+ z (* x (- y -0.5))))
double code(double x, double y, double z) {
return z + (x * (y - -0.5));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z + (x * (y - (-0.5d0)))
end function
public static double code(double x, double y, double z) {
return z + (x * (y - -0.5));
}
def code(x, y, z): return z + (x * (y - -0.5))
function code(x, y, z) return Float64(z + Float64(x * Float64(y - -0.5))) end
function tmp = code(x, y, z) tmp = z + (x * (y - -0.5)); end
code[x_, y_, z_] := N[(z + N[(x * N[(y - -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z + x \cdot \left(y - -0.5\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-neg-in100.0%
distribute-frac-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
neg-mul-1100.0%
associate-/l*100.0%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification100.0%
(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 100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-neg-in100.0%
distribute-frac-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
neg-mul-1100.0%
associate-/l*100.0%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 75.4%
mul-1-neg75.4%
distribute-rgt-neg-out75.4%
Simplified75.4%
Taylor expanded in z around inf 39.3%
Final simplification39.3%
herbie shell --seed 2023321
(FPCore (x y z)
:name "Data.Histogram.Bin.BinF:$cfromIndex from histogram-fill-0.8.4.1"
:precision binary64
(+ (+ (/ x 2.0) (* y x)) z))