
(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 (fma x (+ y 0.5) z))
double code(double x, double y, double z) {
return fma(x, (y + 0.5), z);
}
function code(x, y, z) return fma(x, Float64(y + 0.5), z) end
code[x_, y_, z_] := N[(x * N[(y + 0.5), $MachinePrecision] + z), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y + 0.5, z\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
distribute-frac-neg100.0%
sub-neg100.0%
neg-mul-1100.0%
associate-/l*99.9%
associate-/r/100.0%
distribute-rgt-out--100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(if (<= y -0.5)
(* x y)
(if (<= y -3.8e-118)
(* x 0.5)
(if (<= y -1.5e-238)
z
(if (<= y 1.9e-218)
(* x 0.5)
(if (<= y 2.6e-131)
z
(if (<= y 5.2e-18) (* x 0.5) (if (<= y 2.15e+47) z (* x y)))))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -0.5) {
tmp = x * y;
} else if (y <= -3.8e-118) {
tmp = x * 0.5;
} else if (y <= -1.5e-238) {
tmp = z;
} else if (y <= 1.9e-218) {
tmp = x * 0.5;
} else if (y <= 2.6e-131) {
tmp = z;
} else if (y <= 5.2e-18) {
tmp = x * 0.5;
} else if (y <= 2.15e+47) {
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 <= (-0.5d0)) then
tmp = x * y
else if (y <= (-3.8d-118)) then
tmp = x * 0.5d0
else if (y <= (-1.5d-238)) then
tmp = z
else if (y <= 1.9d-218) then
tmp = x * 0.5d0
else if (y <= 2.6d-131) then
tmp = z
else if (y <= 5.2d-18) then
tmp = x * 0.5d0
else if (y <= 2.15d+47) 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 <= -0.5) {
tmp = x * y;
} else if (y <= -3.8e-118) {
tmp = x * 0.5;
} else if (y <= -1.5e-238) {
tmp = z;
} else if (y <= 1.9e-218) {
tmp = x * 0.5;
} else if (y <= 2.6e-131) {
tmp = z;
} else if (y <= 5.2e-18) {
tmp = x * 0.5;
} else if (y <= 2.15e+47) {
tmp = z;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -0.5: tmp = x * y elif y <= -3.8e-118: tmp = x * 0.5 elif y <= -1.5e-238: tmp = z elif y <= 1.9e-218: tmp = x * 0.5 elif y <= 2.6e-131: tmp = z elif y <= 5.2e-18: tmp = x * 0.5 elif y <= 2.15e+47: tmp = z else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -0.5) tmp = Float64(x * y); elseif (y <= -3.8e-118) tmp = Float64(x * 0.5); elseif (y <= -1.5e-238) tmp = z; elseif (y <= 1.9e-218) tmp = Float64(x * 0.5); elseif (y <= 2.6e-131) tmp = z; elseif (y <= 5.2e-18) tmp = Float64(x * 0.5); elseif (y <= 2.15e+47) tmp = z; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -0.5) tmp = x * y; elseif (y <= -3.8e-118) tmp = x * 0.5; elseif (y <= -1.5e-238) tmp = z; elseif (y <= 1.9e-218) tmp = x * 0.5; elseif (y <= 2.6e-131) tmp = z; elseif (y <= 5.2e-18) tmp = x * 0.5; elseif (y <= 2.15e+47) tmp = z; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -0.5], N[(x * y), $MachinePrecision], If[LessEqual[y, -3.8e-118], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, -1.5e-238], z, If[LessEqual[y, 1.9e-218], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 2.6e-131], z, If[LessEqual[y, 5.2e-18], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 2.15e+47], z, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.5:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-118}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-238}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-218}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-131}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-18}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+47}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -0.5 or 2.14999999999999997e47 < 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 69.8%
if -0.5 < y < -3.8000000000000001e-118 or -1.5e-238 < y < 1.8999999999999999e-218 or 2.59999999999999996e-131 < y < 5.2000000000000001e-18Initial 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 z around 0 62.3%
Taylor expanded in y around 0 61.5%
*-commutative61.5%
Simplified61.5%
if -3.8000000000000001e-118 < y < -1.5e-238 or 1.8999999999999999e-218 < y < 2.59999999999999996e-131 or 5.2000000000000001e-18 < y < 2.14999999999999997e47Initial 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 z around inf 75.1%
Final simplification68.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4e-26) (not (<= x 7.2e-35))) (* x (+ y 0.5)) z))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4e-26) || !(x <= 7.2e-35)) {
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 ((x <= (-1.4d-26)) .or. (.not. (x <= 7.2d-35))) 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 ((x <= -1.4e-26) || !(x <= 7.2e-35)) {
tmp = x * (y + 0.5);
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4e-26) or not (x <= 7.2e-35): tmp = x * (y + 0.5) else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4e-26) || !(x <= 7.2e-35)) 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 ((x <= -1.4e-26) || ~((x <= 7.2e-35))) tmp = x * (y + 0.5); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.4e-26], N[Not[LessEqual[x, 7.2e-35]], $MachinePrecision]], N[(x * N[(y + 0.5), $MachinePrecision]), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-26} \lor \neg \left(x \leq 7.2 \cdot 10^{-35}\right):\\
\;\;\;\;x \cdot \left(y + 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.4000000000000001e-26 or 7.20000000000000038e-35 < x 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*99.9%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 83.8%
if -1.4000000000000001e-26 < x < 7.20000000000000038e-35Initial 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 z around inf 76.0%
Final simplification80.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.15e-23) (not (<= x 0.13))) (* x (+ y 0.5)) (+ z (* x y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.15e-23) || !(x <= 0.13)) {
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 <= (-2.15d-23)) .or. (.not. (x <= 0.13d0))) 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 <= -2.15e-23) || !(x <= 0.13)) {
tmp = x * (y + 0.5);
} else {
tmp = z + (x * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.15e-23) or not (x <= 0.13): tmp = x * (y + 0.5) else: tmp = z + (x * y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.15e-23) || !(x <= 0.13)) 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 <= -2.15e-23) || ~((x <= 0.13))) tmp = x * (y + 0.5); else tmp = z + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.15e-23], N[Not[LessEqual[x, 0.13]], $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 -2.15 \cdot 10^{-23} \lor \neg \left(x \leq 0.13\right):\\
\;\;\;\;x \cdot \left(y + 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z + x \cdot y\\
\end{array}
\end{array}
if x < -2.15000000000000001e-23 or 0.13 < x 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*99.9%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 84.2%
if -2.15000000000000001e-23 < x < 0.13Initial 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 91.3%
mul-1-neg91.3%
*-commutative91.3%
distribute-rgt-neg-in91.3%
Simplified91.3%
sub-neg91.3%
+-commutative91.3%
distribute-rgt-neg-out91.3%
remove-double-neg91.3%
Applied egg-rr91.3%
Final simplification87.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.05e+22) (not (<= y 6.5e-18))) (+ z (* x y)) (- z (* x -0.5))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.05e+22) || !(y <= 6.5e-18)) {
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.05d+22)) .or. (.not. (y <= 6.5d-18))) 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.05e+22) || !(y <= 6.5e-18)) {
tmp = z + (x * y);
} else {
tmp = z - (x * -0.5);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.05e+22) or not (y <= 6.5e-18): tmp = z + (x * y) else: tmp = z - (x * -0.5) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.05e+22) || !(y <= 6.5e-18)) 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.05e+22) || ~((y <= 6.5e-18))) tmp = z + (x * y); else tmp = z - (x * -0.5); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.05e+22], N[Not[LessEqual[y, 6.5e-18]], $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.05 \cdot 10^{+22} \lor \neg \left(y \leq 6.5 \cdot 10^{-18}\right):\\
\;\;\;\;z + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z - x \cdot -0.5\\
\end{array}
\end{array}
if y < -3.0499999999999999e22 or 6.50000000000000008e-18 < 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 100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-neg-out100.0%
remove-double-neg100.0%
Applied egg-rr100.0%
if -3.0499999999999999e22 < y < 6.50000000000000008e-18Initial 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.5%
*-commutative99.5%
Simplified99.5%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.8e-24) (not (<= x 9.5e-7))) (* x 0.5) z))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.8e-24) || !(x <= 9.5e-7)) {
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 <= (-5.8d-24)) .or. (.not. (x <= 9.5d-7))) 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 <= -5.8e-24) || !(x <= 9.5e-7)) {
tmp = x * 0.5;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.8e-24) or not (x <= 9.5e-7): tmp = x * 0.5 else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.8e-24) || !(x <= 9.5e-7)) tmp = Float64(x * 0.5); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -5.8e-24) || ~((x <= 9.5e-7))) tmp = x * 0.5; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.8e-24], N[Not[LessEqual[x, 9.5e-7]], $MachinePrecision]], N[(x * 0.5), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-24} \lor \neg \left(x \leq 9.5 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -5.7999999999999997e-24 or 9.5000000000000001e-7 < x 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*99.9%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 84.2%
Taylor expanded in y around 0 43.3%
*-commutative43.3%
Simplified43.3%
if -5.7999999999999997e-24 < x < 9.5000000000000001e-7Initial 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 z around inf 75.6%
Final simplification58.3%
(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*99.9%
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*99.9%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 44.3%
Final simplification44.3%
herbie shell --seed 2024027
(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))