
(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 -2.1e-193)
(* x 0.5)
(if (<= y -2.1e-277)
z
(if (<= y 1.6e-225)
(* x 0.5)
(if (<= y 1.6e-176)
z
(if (<= y 1.35e-53) (* x 0.5) (if (<= y 3.9e+85) z (* x y)))))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -0.5) {
tmp = x * y;
} else if (y <= -2.1e-193) {
tmp = x * 0.5;
} else if (y <= -2.1e-277) {
tmp = z;
} else if (y <= 1.6e-225) {
tmp = x * 0.5;
} else if (y <= 1.6e-176) {
tmp = z;
} else if (y <= 1.35e-53) {
tmp = x * 0.5;
} else if (y <= 3.9e+85) {
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 <= (-2.1d-193)) then
tmp = x * 0.5d0
else if (y <= (-2.1d-277)) then
tmp = z
else if (y <= 1.6d-225) then
tmp = x * 0.5d0
else if (y <= 1.6d-176) then
tmp = z
else if (y <= 1.35d-53) then
tmp = x * 0.5d0
else if (y <= 3.9d+85) 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 <= -2.1e-193) {
tmp = x * 0.5;
} else if (y <= -2.1e-277) {
tmp = z;
} else if (y <= 1.6e-225) {
tmp = x * 0.5;
} else if (y <= 1.6e-176) {
tmp = z;
} else if (y <= 1.35e-53) {
tmp = x * 0.5;
} else if (y <= 3.9e+85) {
tmp = z;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -0.5: tmp = x * y elif y <= -2.1e-193: tmp = x * 0.5 elif y <= -2.1e-277: tmp = z elif y <= 1.6e-225: tmp = x * 0.5 elif y <= 1.6e-176: tmp = z elif y <= 1.35e-53: tmp = x * 0.5 elif y <= 3.9e+85: 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 <= -2.1e-193) tmp = Float64(x * 0.5); elseif (y <= -2.1e-277) tmp = z; elseif (y <= 1.6e-225) tmp = Float64(x * 0.5); elseif (y <= 1.6e-176) tmp = z; elseif (y <= 1.35e-53) tmp = Float64(x * 0.5); elseif (y <= 3.9e+85) 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 <= -2.1e-193) tmp = x * 0.5; elseif (y <= -2.1e-277) tmp = z; elseif (y <= 1.6e-225) tmp = x * 0.5; elseif (y <= 1.6e-176) tmp = z; elseif (y <= 1.35e-53) tmp = x * 0.5; elseif (y <= 3.9e+85) 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, -2.1e-193], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, -2.1e-277], z, If[LessEqual[y, 1.6e-225], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 1.6e-176], z, If[LessEqual[y, 1.35e-53], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 3.9e+85], z, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.5:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-193}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-277}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-225}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-176}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-53}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+85}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -0.5 or 3.90000000000000033e85 < 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 73.5%
if -0.5 < y < -2.0999999999999999e-193 or -2.09999999999999995e-277 < y < 1.59999999999999987e-225 or 1.59999999999999992e-176 < y < 1.35e-53Initial 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.8%
associate-/r/100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 62.0%
Taylor expanded in y around 0 61.2%
*-commutative61.2%
Simplified61.2%
if -2.0999999999999999e-193 < y < -2.09999999999999995e-277 or 1.59999999999999987e-225 < y < 1.59999999999999992e-176 or 1.35e-53 < y < 3.90000000000000033e85Initial 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 z around inf 68.0%
Final simplification67.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.9e-15) (not (<= z 5.6e+23))) (+ z (* x y)) (* x (+ y 0.5))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.9e-15) || !(z <= 5.6e+23)) {
tmp = z + (x * y);
} else {
tmp = x * (y + 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 ((z <= (-1.9d-15)) .or. (.not. (z <= 5.6d+23))) then
tmp = z + (x * y)
else
tmp = x * (y + 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.9e-15) || !(z <= 5.6e+23)) {
tmp = z + (x * y);
} else {
tmp = x * (y + 0.5);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.9e-15) or not (z <= 5.6e+23): tmp = z + (x * y) else: tmp = x * (y + 0.5) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.9e-15) || !(z <= 5.6e+23)) tmp = Float64(z + Float64(x * y)); else tmp = Float64(x * Float64(y + 0.5)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.9e-15) || ~((z <= 5.6e+23))) tmp = z + (x * y); else tmp = x * (y + 0.5); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.9e-15], N[Not[LessEqual[z, 5.6e+23]], $MachinePrecision]], N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-15} \lor \neg \left(z \leq 5.6 \cdot 10^{+23}\right):\\
\;\;\;\;z + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + 0.5\right)\\
\end{array}
\end{array}
if z < -1.9000000000000001e-15 or 5.6e23 < 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 89.9%
mul-1-neg89.9%
*-commutative89.9%
distribute-rgt-neg-in89.9%
Simplified89.9%
sub-neg89.9%
+-commutative89.9%
distribute-rgt-neg-out89.9%
remove-double-neg89.9%
Applied egg-rr89.9%
if -1.9000000000000001e-15 < z < 5.6e23Initial 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 85.9%
Final simplification87.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.5) (not (<= y 0.019))) (+ z (* x y)) (- z (* x -0.5))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.5) || !(y <= 0.019)) {
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 <= (-0.5d0)) .or. (.not. (y <= 0.019d0))) 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 <= -0.5) || !(y <= 0.019)) {
tmp = z + (x * y);
} else {
tmp = z - (x * -0.5);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.5) or not (y <= 0.019): tmp = z + (x * y) else: tmp = z - (x * -0.5) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.5) || !(y <= 0.019)) 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 <= -0.5) || ~((y <= 0.019))) tmp = z + (x * y); else tmp = z - (x * -0.5); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.5], N[Not[LessEqual[y, 0.019]], $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 -0.5 \lor \neg \left(y \leq 0.019\right):\\
\;\;\;\;z + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z - x \cdot -0.5\\
\end{array}
\end{array}
if y < -0.5 or 0.0189999999999999995 < 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 98.4%
mul-1-neg98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
Simplified98.4%
sub-neg98.4%
+-commutative98.4%
distribute-rgt-neg-out98.4%
remove-double-neg98.4%
Applied egg-rr98.4%
if -0.5 < y < 0.0189999999999999995Initial 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 98.8%
*-commutative98.8%
Simplified98.8%
Final simplification98.6%
(FPCore (x y z) :precision binary64 (if (<= z -8.5e+144) z (if (<= z 5.4e+24) (* x (+ y 0.5)) z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -8.5e+144) {
tmp = z;
} else if (z <= 5.4e+24) {
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 <= (-8.5d+144)) then
tmp = z
else if (z <= 5.4d+24) 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 <= -8.5e+144) {
tmp = z;
} else if (z <= 5.4e+24) {
tmp = x * (y + 0.5);
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -8.5e+144: tmp = z elif z <= 5.4e+24: tmp = x * (y + 0.5) else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -8.5e+144) tmp = z; elseif (z <= 5.4e+24) 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 <= -8.5e+144) tmp = z; elseif (z <= 5.4e+24) tmp = x * (y + 0.5); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -8.5e+144], z, If[LessEqual[z, 5.4e+24], N[(x * N[(y + 0.5), $MachinePrecision]), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+144}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \left(y + 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -8.4999999999999998e144 or 5.4e24 < 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 z around inf 75.5%
if -8.4999999999999998e144 < z < 5.4e24Initial 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 81.5%
Final simplification79.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.9e+100) (not (<= x 1.05e+82))) (* x 0.5) z))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.9e+100) || !(x <= 1.05e+82)) {
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 <= (-2.9d+100)) .or. (.not. (x <= 1.05d+82))) 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 <= -2.9e+100) || !(x <= 1.05e+82)) {
tmp = x * 0.5;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.9e+100) or not (x <= 1.05e+82): tmp = x * 0.5 else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.9e+100) || !(x <= 1.05e+82)) tmp = Float64(x * 0.5); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.9e+100) || ~((x <= 1.05e+82))) tmp = x * 0.5; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.9e+100], N[Not[LessEqual[x, 1.05e+82]], $MachinePrecision]], N[(x * 0.5), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+100} \lor \neg \left(x \leq 1.05 \cdot 10^{+82}\right):\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.9e100 or 1.05e82 < 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 94.6%
Taylor expanded in y around 0 49.1%
*-commutative49.1%
Simplified49.1%
if -2.9e100 < x < 1.05e82Initial 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 56.4%
Final simplification53.9%
(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 39.5%
Final simplification39.5%
herbie shell --seed 2024026
(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))