
(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 -1.2e+62)
(* x y)
(if (<= y -1.12e-63)
z
(if (<= y -8.2e-152)
(* x 0.5)
(if (<= y 1.05e-150)
z
(if (<= y 1.15e-106)
(* x 0.5)
(if (<= y 8e-45) z (if (<= y 0.5) (* x 0.5) (* x y)))))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.2e+62) {
tmp = x * y;
} else if (y <= -1.12e-63) {
tmp = z;
} else if (y <= -8.2e-152) {
tmp = x * 0.5;
} else if (y <= 1.05e-150) {
tmp = z;
} else if (y <= 1.15e-106) {
tmp = x * 0.5;
} else if (y <= 8e-45) {
tmp = z;
} else if (y <= 0.5) {
tmp = x * 0.5;
} 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 <= (-1.2d+62)) then
tmp = x * y
else if (y <= (-1.12d-63)) then
tmp = z
else if (y <= (-8.2d-152)) then
tmp = x * 0.5d0
else if (y <= 1.05d-150) then
tmp = z
else if (y <= 1.15d-106) then
tmp = x * 0.5d0
else if (y <= 8d-45) then
tmp = z
else if (y <= 0.5d0) then
tmp = x * 0.5d0
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.2e+62) {
tmp = x * y;
} else if (y <= -1.12e-63) {
tmp = z;
} else if (y <= -8.2e-152) {
tmp = x * 0.5;
} else if (y <= 1.05e-150) {
tmp = z;
} else if (y <= 1.15e-106) {
tmp = x * 0.5;
} else if (y <= 8e-45) {
tmp = z;
} else if (y <= 0.5) {
tmp = x * 0.5;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.2e+62: tmp = x * y elif y <= -1.12e-63: tmp = z elif y <= -8.2e-152: tmp = x * 0.5 elif y <= 1.05e-150: tmp = z elif y <= 1.15e-106: tmp = x * 0.5 elif y <= 8e-45: tmp = z elif y <= 0.5: tmp = x * 0.5 else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.2e+62) tmp = Float64(x * y); elseif (y <= -1.12e-63) tmp = z; elseif (y <= -8.2e-152) tmp = Float64(x * 0.5); elseif (y <= 1.05e-150) tmp = z; elseif (y <= 1.15e-106) tmp = Float64(x * 0.5); elseif (y <= 8e-45) tmp = z; elseif (y <= 0.5) tmp = Float64(x * 0.5); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.2e+62) tmp = x * y; elseif (y <= -1.12e-63) tmp = z; elseif (y <= -8.2e-152) tmp = x * 0.5; elseif (y <= 1.05e-150) tmp = z; elseif (y <= 1.15e-106) tmp = x * 0.5; elseif (y <= 8e-45) tmp = z; elseif (y <= 0.5) tmp = x * 0.5; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.2e+62], N[(x * y), $MachinePrecision], If[LessEqual[y, -1.12e-63], z, If[LessEqual[y, -8.2e-152], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 1.05e-150], z, If[LessEqual[y, 1.15e-106], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 8e-45], z, If[LessEqual[y, 0.5], N[(x * 0.5), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+62}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -1.12 \cdot 10^{-63}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{-152}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-150}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-106}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-45}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 0.5:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -1.2e62 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%
flip--59.0%
associate-*r/50.6%
metadata-eval50.6%
pow250.6%
+-commutative50.6%
Applied egg-rr50.6%
*-commutative50.6%
associate-/l*57.6%
Simplified57.6%
Taylor expanded in y around inf 68.8%
if -1.2e62 < y < -1.12000000000000002e-63 or -8.2000000000000002e-152 < y < 1.0500000000000001e-150 or 1.15e-106 < y < 7.99999999999999987e-45Initial 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%
flip--100.0%
associate-*r/99.1%
metadata-eval99.1%
pow299.1%
+-commutative99.1%
Applied egg-rr99.1%
*-commutative99.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 62.3%
if -1.12000000000000002e-63 < y < -8.2000000000000002e-152 or 1.0500000000000001e-150 < y < 1.15e-106 or 7.99999999999999987e-45 < y < 0.5Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 70.0%
+-commutative70.0%
Simplified70.0%
Taylor expanded in y around 0 68.9%
*-commutative68.9%
Simplified68.9%
Final simplification66.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.8e-16) (not (<= z 1.05e-23))) (+ (* x y) z) (* x (+ y 0.5))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.8e-16) || !(z <= 1.05e-23)) {
tmp = (x * y) + z;
} 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 <= (-3.8d-16)) .or. (.not. (z <= 1.05d-23))) then
tmp = (x * y) + z
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 <= -3.8e-16) || !(z <= 1.05e-23)) {
tmp = (x * y) + z;
} else {
tmp = x * (y + 0.5);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.8e-16) or not (z <= 1.05e-23): tmp = (x * y) + z else: tmp = x * (y + 0.5) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.8e-16) || !(z <= 1.05e-23)) tmp = Float64(Float64(x * y) + z); else tmp = Float64(x * Float64(y + 0.5)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.8e-16) || ~((z <= 1.05e-23))) tmp = (x * y) + z; else tmp = x * (y + 0.5); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.8e-16], N[Not[LessEqual[z, 1.05e-23]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision], N[(x * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-16} \lor \neg \left(z \leq 1.05 \cdot 10^{-23}\right):\\
\;\;\;\;x \cdot y + z\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + 0.5\right)\\
\end{array}
\end{array}
if z < -3.80000000000000012e-16 or 1.05e-23 < 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 90.5%
associate-*r*90.5%
neg-mul-190.5%
Simplified90.5%
cancel-sign-sub90.5%
+-commutative90.5%
*-commutative90.5%
Applied egg-rr90.5%
if -3.80000000000000012e-16 < z < 1.05e-23Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 87.3%
+-commutative87.3%
Simplified87.3%
Final simplification89.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.5) (not (<= y 0.0045))) (+ (* x y) z) (- z (* x -0.5))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.5) || !(y <= 0.0045)) {
tmp = (x * y) + z;
} 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.0045d0))) then
tmp = (x * y) + z
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.0045)) {
tmp = (x * y) + z;
} else {
tmp = z - (x * -0.5);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.5) or not (y <= 0.0045): tmp = (x * y) + z else: tmp = z - (x * -0.5) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.5) || !(y <= 0.0045)) tmp = Float64(Float64(x * y) + z); 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.0045))) tmp = (x * y) + z; 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.0045]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + z), $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.0045\right):\\
\;\;\;\;x \cdot y + z\\
\mathbf{else}:\\
\;\;\;\;z - x \cdot -0.5\\
\end{array}
\end{array}
if y < -0.5 or 0.00449999999999999966 < 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.0%
associate-*r*98.0%
neg-mul-198.0%
Simplified98.0%
cancel-sign-sub98.0%
+-commutative98.0%
*-commutative98.0%
Applied egg-rr98.0%
if -0.5 < y < 0.00449999999999999966Initial 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.0%
*-commutative98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (if (<= z -1.06e+114) z (if (<= z 6e+169) (* x (+ y 0.5)) z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.06e+114) {
tmp = z;
} else if (z <= 6e+169) {
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 <= (-1.06d+114)) then
tmp = z
else if (z <= 6d+169) 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 <= -1.06e+114) {
tmp = z;
} else if (z <= 6e+169) {
tmp = x * (y + 0.5);
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.06e+114: tmp = z elif z <= 6e+169: tmp = x * (y + 0.5) else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.06e+114) tmp = z; elseif (z <= 6e+169) 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 <= -1.06e+114) tmp = z; elseif (z <= 6e+169) tmp = x * (y + 0.5); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.06e+114], z, If[LessEqual[z, 6e+169], N[(x * N[(y + 0.5), $MachinePrecision]), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+114}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+169}:\\
\;\;\;\;x \cdot \left(y + 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.05999999999999993e114 or 5.9999999999999999e169 < 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%
flip--81.0%
associate-*r/77.5%
metadata-eval77.5%
pow277.5%
+-commutative77.5%
Applied egg-rr77.5%
*-commutative77.5%
associate-/l*80.2%
Simplified80.2%
Taylor expanded in z around inf 86.4%
if -1.05999999999999993e114 < z < 5.9999999999999999e169Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 78.2%
+-commutative78.2%
Simplified78.2%
Final simplification80.8%
(FPCore (x y z) :precision binary64 (if (<= z -5.5e-11) z (if (<= z 2.35e-26) (* x 0.5) z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.5e-11) {
tmp = z;
} else if (z <= 2.35e-26) {
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 (z <= (-5.5d-11)) then
tmp = z
else if (z <= 2.35d-26) 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 (z <= -5.5e-11) {
tmp = z;
} else if (z <= 2.35e-26) {
tmp = x * 0.5;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.5e-11: tmp = z elif z <= 2.35e-26: tmp = x * 0.5 else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.5e-11) tmp = z; elseif (z <= 2.35e-26) tmp = Float64(x * 0.5); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.5e-11) tmp = z; elseif (z <= 2.35e-26) tmp = x * 0.5; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.5e-11], z, If[LessEqual[z, 2.35e-26], N[(x * 0.5), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-11}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-26}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -5.49999999999999975e-11 or 2.34999999999999995e-26 < 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%
flip--81.6%
associate-*r/76.3%
metadata-eval76.3%
pow276.3%
+-commutative76.3%
Applied egg-rr76.3%
*-commutative76.3%
associate-/l*80.9%
Simplified80.9%
Taylor expanded in z around inf 66.8%
if -5.49999999999999975e-11 < z < 2.34999999999999995e-26Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in y around 0 45.9%
*-commutative45.9%
Simplified45.9%
Final simplification57.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*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%
flip--82.2%
associate-*r/78.2%
metadata-eval78.2%
pow278.2%
+-commutative78.2%
Applied egg-rr78.2%
*-commutative78.2%
associate-/l*81.5%
Simplified81.5%
Taylor expanded in z around inf 43.2%
Final simplification43.2%
herbie shell --seed 2024031
(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))