
(FPCore (x y z) :precision binary64 (* (+ x y) (- 1.0 z)))
double code(double x, double y, double z) {
return (x + y) * (1.0 - 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 + y) * (1.0d0 - z)
end function
public static double code(double x, double y, double z) {
return (x + y) * (1.0 - z);
}
def code(x, y, z): return (x + y) * (1.0 - z)
function code(x, y, z) return Float64(Float64(x + y) * Float64(1.0 - z)) end
function tmp = code(x, y, z) tmp = (x + y) * (1.0 - z); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) \cdot \left(1 - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (* (+ x y) (- 1.0 z)))
double code(double x, double y, double z) {
return (x + y) * (1.0 - 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 + y) * (1.0d0 - z)
end function
public static double code(double x, double y, double z) {
return (x + y) * (1.0 - z);
}
def code(x, y, z): return (x + y) * (1.0 - z)
function code(x, y, z) return Float64(Float64(x + y) * Float64(1.0 - z)) end
function tmp = code(x, y, z) tmp = (x + y) * (1.0 - z); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) \cdot \left(1 - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (- (+ x y) (* z (+ x y))))
double code(double x, double y, double z) {
return (x + y) - (z * (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 + y) - (z * (x + y))
end function
public static double code(double x, double y, double z) {
return (x + y) - (z * (x + y));
}
def code(x, y, z): return (x + y) - (z * (x + y))
function code(x, y, z) return Float64(Float64(x + y) - Float64(z * Float64(x + y))) end
function tmp = code(x, y, z) tmp = (x + y) - (z * (x + y)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] - N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - z \cdot \left(x + y\right)
\end{array}
Initial program 100.0%
sub-neg100.0%
distribute-lft-in100.0%
*-commutative100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- 1.0 z))))
(if (<= x -1.15e-24)
t_0
(if (<= x -8.8e-58) (+ x y) (if (<= x -4.15e-72) t_0 (* y (- 1.0 z)))))))
double code(double x, double y, double z) {
double t_0 = x * (1.0 - z);
double tmp;
if (x <= -1.15e-24) {
tmp = t_0;
} else if (x <= -8.8e-58) {
tmp = x + y;
} else if (x <= -4.15e-72) {
tmp = t_0;
} else {
tmp = y * (1.0 - 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) :: t_0
real(8) :: tmp
t_0 = x * (1.0d0 - z)
if (x <= (-1.15d-24)) then
tmp = t_0
else if (x <= (-8.8d-58)) then
tmp = x + y
else if (x <= (-4.15d-72)) then
tmp = t_0
else
tmp = y * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (1.0 - z);
double tmp;
if (x <= -1.15e-24) {
tmp = t_0;
} else if (x <= -8.8e-58) {
tmp = x + y;
} else if (x <= -4.15e-72) {
tmp = t_0;
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
def code(x, y, z): t_0 = x * (1.0 - z) tmp = 0 if x <= -1.15e-24: tmp = t_0 elif x <= -8.8e-58: tmp = x + y elif x <= -4.15e-72: tmp = t_0 else: tmp = y * (1.0 - z) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(1.0 - z)) tmp = 0.0 if (x <= -1.15e-24) tmp = t_0; elseif (x <= -8.8e-58) tmp = Float64(x + y); elseif (x <= -4.15e-72) tmp = t_0; else tmp = Float64(y * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (1.0 - z); tmp = 0.0; if (x <= -1.15e-24) tmp = t_0; elseif (x <= -8.8e-58) tmp = x + y; elseif (x <= -4.15e-72) tmp = t_0; else tmp = y * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e-24], t$95$0, If[LessEqual[x, -8.8e-58], N[(x + y), $MachinePrecision], If[LessEqual[x, -4.15e-72], t$95$0, N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(1 - z\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{-24}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -8.8 \cdot 10^{-58}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x \leq -4.15 \cdot 10^{-72}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if x < -1.1500000000000001e-24 or -8.80000000000000023e-58 < x < -4.1499999999999999e-72Initial program 100.0%
Taylor expanded in x around inf 79.1%
*-commutative79.1%
Simplified79.1%
if -1.1500000000000001e-24 < x < -8.80000000000000023e-58Initial program 100.0%
Taylor expanded in z around 0 76.3%
+-commutative76.3%
Simplified76.3%
if -4.1499999999999999e-72 < x Initial program 100.0%
Taylor expanded in x around 0 58.8%
Final simplification64.8%
(FPCore (x y z)
:precision binary64
(if (<= x -1.45e-28)
(- x (* x z))
(if (<= x -8e-58)
(+ x y)
(if (<= x -6.4e-72) (* x (- 1.0 z)) (* y (- 1.0 z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.45e-28) {
tmp = x - (x * z);
} else if (x <= -8e-58) {
tmp = x + y;
} else if (x <= -6.4e-72) {
tmp = x * (1.0 - z);
} else {
tmp = y * (1.0 - 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.45d-28)) then
tmp = x - (x * z)
else if (x <= (-8d-58)) then
tmp = x + y
else if (x <= (-6.4d-72)) then
tmp = x * (1.0d0 - z)
else
tmp = y * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.45e-28) {
tmp = x - (x * z);
} else if (x <= -8e-58) {
tmp = x + y;
} else if (x <= -6.4e-72) {
tmp = x * (1.0 - z);
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.45e-28: tmp = x - (x * z) elif x <= -8e-58: tmp = x + y elif x <= -6.4e-72: tmp = x * (1.0 - z) else: tmp = y * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.45e-28) tmp = Float64(x - Float64(x * z)); elseif (x <= -8e-58) tmp = Float64(x + y); elseif (x <= -6.4e-72) tmp = Float64(x * Float64(1.0 - z)); else tmp = Float64(y * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.45e-28) tmp = x - (x * z); elseif (x <= -8e-58) tmp = x + y; elseif (x <= -6.4e-72) tmp = x * (1.0 - z); else tmp = y * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.45e-28], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-58], N[(x + y), $MachinePrecision], If[LessEqual[x, -6.4e-72], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-28}:\\
\;\;\;\;x - x \cdot z\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-58}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x \leq -6.4 \cdot 10^{-72}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if x < -1.45000000000000006e-28Initial program 100.0%
sub-neg100.0%
distribute-lft-in100.0%
*-commutative100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 80.0%
mul-1-neg80.0%
unsub-neg80.0%
*-commutative80.0%
Applied egg-rr80.0%
if -1.45000000000000006e-28 < x < -8.0000000000000002e-58Initial program 100.0%
Taylor expanded in z around 0 76.3%
+-commutative76.3%
Simplified76.3%
if -8.0000000000000002e-58 < x < -6.39999999999999998e-72Initial program 100.0%
Taylor expanded in x around inf 63.2%
*-commutative63.2%
Simplified63.2%
if -6.39999999999999998e-72 < x Initial program 100.0%
Taylor expanded in x around 0 58.8%
Final simplification64.8%
(FPCore (x y z) :precision binary64 (if (or (<= (- 1.0 z) -5000.0) (not (<= (- 1.0 z) 2.0))) (* z (- (- x) y)) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if (((1.0 - z) <= -5000.0) || !((1.0 - z) <= 2.0)) {
tmp = z * (-x - y);
} 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 (((1.0d0 - z) <= (-5000.0d0)) .or. (.not. ((1.0d0 - z) <= 2.0d0))) then
tmp = z * (-x - y)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (((1.0 - z) <= -5000.0) || !((1.0 - z) <= 2.0)) {
tmp = z * (-x - y);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((1.0 - z) <= -5000.0) or not ((1.0 - z) <= 2.0): tmp = z * (-x - y) else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((Float64(1.0 - z) <= -5000.0) || !(Float64(1.0 - z) <= 2.0)) tmp = Float64(z * Float64(Float64(-x) - y)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((1.0 - z) <= -5000.0) || ~(((1.0 - z) <= 2.0))) tmp = z * (-x - y); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[N[(1.0 - z), $MachinePrecision], -5000.0], N[Not[LessEqual[N[(1.0 - z), $MachinePrecision], 2.0]], $MachinePrecision]], N[(z * N[((-x) - y), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;1 - z \leq -5000 \lor \neg \left(1 - z \leq 2\right):\\
\;\;\;\;z \cdot \left(\left(-x\right) - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) z) < -5e3 or 2 < (-.f64 #s(literal 1 binary64) z) Initial program 100.0%
Taylor expanded in z around inf 97.7%
mul-1-neg97.7%
distribute-lft-neg-out97.7%
*-commutative97.7%
+-commutative97.7%
Simplified97.7%
if -5e3 < (-.f64 #s(literal 1 binary64) z) < 2Initial program 100.0%
Taylor expanded in z around 0 98.6%
+-commutative98.6%
Simplified98.6%
Final simplification98.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -11.0) (not (<= z 1.0))) (* x (- z)) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -11.0) || !(z <= 1.0)) {
tmp = x * -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 ((z <= (-11.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -11.0) || !(z <= 1.0)) {
tmp = x * -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -11.0) or not (z <= 1.0): tmp = x * -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -11.0) || !(z <= 1.0)) tmp = Float64(x * Float64(-z)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -11.0) || ~((z <= 1.0))) tmp = x * -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -11.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * (-z)), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -11 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -11 or 1 < z Initial program 100.0%
sub-neg100.0%
distribute-lft-in99.9%
*-commutative99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 48.6%
Taylor expanded in z around inf 46.8%
associate-*r*46.8%
neg-mul-146.8%
Simplified46.8%
if -11 < z < 1Initial program 100.0%
Taylor expanded in z around 0 98.6%
+-commutative98.6%
Simplified98.6%
Final simplification74.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -130.0) (not (<= z 1.0))) (* y (- z)) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -130.0) || !(z <= 1.0)) {
tmp = y * -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 ((z <= (-130.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = y * -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -130.0) || !(z <= 1.0)) {
tmp = y * -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -130.0) or not (z <= 1.0): tmp = y * -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -130.0) || !(z <= 1.0)) tmp = Float64(y * Float64(-z)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -130.0) || ~((z <= 1.0))) tmp = y * -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -130.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(y * (-z)), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -130 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -130 or 1 < z Initial program 100.0%
*-commutative100.0%
+-commutative100.0%
distribute-lft-in94.9%
Applied egg-rr94.9%
Taylor expanded in z around inf 94.4%
mul-1-neg94.4%
distribute-rgt-neg-in94.4%
Simplified94.4%
Taylor expanded in y around inf 54.7%
associate-*r*54.7%
mul-1-neg54.7%
Simplified54.7%
if -130 < z < 1Initial program 100.0%
Taylor expanded in z around 0 97.9%
+-commutative97.9%
Simplified97.9%
Final simplification78.0%
(FPCore (x y z) :precision binary64 (if (<= z -2.55e-13) (* y (- 1.0 z)) (if (<= z 1.0) (+ x y) (* y (- z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.55e-13) {
tmp = y * (1.0 - z);
} else if (z <= 1.0) {
tmp = x + y;
} else {
tmp = y * -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 <= (-2.55d-13)) then
tmp = y * (1.0d0 - z)
else if (z <= 1.0d0) then
tmp = x + y
else
tmp = y * -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.55e-13) {
tmp = y * (1.0 - z);
} else if (z <= 1.0) {
tmp = x + y;
} else {
tmp = y * -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.55e-13: tmp = y * (1.0 - z) elif z <= 1.0: tmp = x + y else: tmp = y * -z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.55e-13) tmp = Float64(y * Float64(1.0 - z)); elseif (z <= 1.0) tmp = Float64(x + y); else tmp = Float64(y * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.55e-13) tmp = y * (1.0 - z); elseif (z <= 1.0) tmp = x + y; else tmp = y * -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.55e-13], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x + y), $MachinePrecision], N[(y * (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.55 \cdot 10^{-13}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\end{array}
\end{array}
if z < -2.55e-13Initial program 99.9%
Taylor expanded in x around 0 52.2%
if -2.55e-13 < z < 1Initial program 100.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
Simplified100.0%
if 1 < z Initial program 99.9%
*-commutative99.9%
+-commutative99.9%
distribute-lft-in94.4%
Applied egg-rr94.4%
Taylor expanded in z around inf 93.8%
mul-1-neg93.8%
distribute-rgt-neg-in93.8%
Simplified93.8%
Taylor expanded in y around inf 55.4%
associate-*r*55.4%
mul-1-neg55.4%
Simplified55.4%
Final simplification77.7%
(FPCore (x y z) :precision binary64 (* (- 1.0 z) (+ x y)))
double code(double x, double y, double z) {
return (1.0 - z) * (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 = (1.0d0 - z) * (x + y)
end function
public static double code(double x, double y, double z) {
return (1.0 - z) * (x + y);
}
def code(x, y, z): return (1.0 - z) * (x + y)
function code(x, y, z) return Float64(Float64(1.0 - z) * Float64(x + y)) end
function tmp = code(x, y, z) tmp = (1.0 - z) * (x + y); end
code[x_, y_, z_] := N[(N[(1.0 - z), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - z\right) \cdot \left(x + y\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 (if (<= y 1.15e-43) x y))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.15e-43) {
tmp = x;
} else {
tmp = 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.15d-43) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1.15e-43) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.15e-43: tmp = x else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.15e-43) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.15e-43) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.15e-43], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15 \cdot 10^{-43}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 1.1499999999999999e-43Initial program 100.0%
Taylor expanded in x around inf 62.4%
*-commutative62.4%
Simplified62.4%
Taylor expanded in z around 0 38.0%
if 1.1499999999999999e-43 < y Initial program 100.0%
Taylor expanded in x around 0 82.2%
Taylor expanded in z around 0 37.8%
Final simplification37.9%
(FPCore (x y z) :precision binary64 (+ x y))
double code(double x, double y, double z) {
return 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 + y
end function
public static double code(double x, double y, double z) {
return x + y;
}
def code(x, y, z): return x + y
function code(x, y, z) return Float64(x + y) end
function tmp = code(x, y, z) tmp = x + y; end
code[x_, y_, z_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 100.0%
Taylor expanded in z around 0 54.7%
+-commutative54.7%
Simplified54.7%
Final simplification54.7%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return 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
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in x around inf 52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in z around 0 30.3%
Final simplification30.3%
herbie shell --seed 2024066
(FPCore (x y z)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, H"
:precision binary64
(* (+ x y) (- 1.0 z)))