
(FPCore (x y z) :precision binary64 (+ x (/ (- y x) z)))
double code(double x, double y, double z) {
return x + ((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 + ((y - x) / z)
end function
public static double code(double x, double y, double z) {
return x + ((y - x) / z);
}
def code(x, y, z): return x + ((y - x) / z)
function code(x, y, z) return Float64(x + Float64(Float64(y - x) / z)) end
function tmp = code(x, y, z) tmp = x + ((y - x) / z); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - x}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (/ (- y x) z)))
double code(double x, double y, double z) {
return x + ((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 + ((y - x) / z)
end function
public static double code(double x, double y, double z) {
return x + ((y - x) / z);
}
def code(x, y, z): return x + ((y - x) / z)
function code(x, y, z) return Float64(x + Float64(Float64(y - x) / z)) end
function tmp = code(x, y, z) tmp = x + ((y - x) / z); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - x}{z}
\end{array}
(FPCore (x y z) :precision binary64 (+ x (/ (- y x) z)))
double code(double x, double y, double z) {
return x + ((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 + ((y - x) / z)
end function
public static double code(double x, double y, double z) {
return x + ((y - x) / z);
}
def code(x, y, z): return x + ((y - x) / z)
function code(x, y, z) return Float64(x + Float64(Float64(y - x) / z)) end
function tmp = code(x, y, z) tmp = x + ((y - x) / z); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - x}{z}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (- x) z)))
(if (<= z -1.0)
x
(if (<= z -1.05e-153)
t_0
(if (<= z -6.8e-197)
(/ y z)
(if (<= z 6e-200)
t_0
(if (<= z 4.8e-152)
(/ y z)
(if (<= z 4.5e-91) t_0 (if (<= z 10500000000.0) (/ y z) x)))))))))
double code(double x, double y, double z) {
double t_0 = -x / z;
double tmp;
if (z <= -1.0) {
tmp = x;
} else if (z <= -1.05e-153) {
tmp = t_0;
} else if (z <= -6.8e-197) {
tmp = y / z;
} else if (z <= 6e-200) {
tmp = t_0;
} else if (z <= 4.8e-152) {
tmp = y / z;
} else if (z <= 4.5e-91) {
tmp = t_0;
} else if (z <= 10500000000.0) {
tmp = y / z;
} else {
tmp = x;
}
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 / z
if (z <= (-1.0d0)) then
tmp = x
else if (z <= (-1.05d-153)) then
tmp = t_0
else if (z <= (-6.8d-197)) then
tmp = y / z
else if (z <= 6d-200) then
tmp = t_0
else if (z <= 4.8d-152) then
tmp = y / z
else if (z <= 4.5d-91) then
tmp = t_0
else if (z <= 10500000000.0d0) then
tmp = y / z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -x / z;
double tmp;
if (z <= -1.0) {
tmp = x;
} else if (z <= -1.05e-153) {
tmp = t_0;
} else if (z <= -6.8e-197) {
tmp = y / z;
} else if (z <= 6e-200) {
tmp = t_0;
} else if (z <= 4.8e-152) {
tmp = y / z;
} else if (z <= 4.5e-91) {
tmp = t_0;
} else if (z <= 10500000000.0) {
tmp = y / z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = -x / z tmp = 0 if z <= -1.0: tmp = x elif z <= -1.05e-153: tmp = t_0 elif z <= -6.8e-197: tmp = y / z elif z <= 6e-200: tmp = t_0 elif z <= 4.8e-152: tmp = y / z elif z <= 4.5e-91: tmp = t_0 elif z <= 10500000000.0: tmp = y / z else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(Float64(-x) / z) tmp = 0.0 if (z <= -1.0) tmp = x; elseif (z <= -1.05e-153) tmp = t_0; elseif (z <= -6.8e-197) tmp = Float64(y / z); elseif (z <= 6e-200) tmp = t_0; elseif (z <= 4.8e-152) tmp = Float64(y / z); elseif (z <= 4.5e-91) tmp = t_0; elseif (z <= 10500000000.0) tmp = Float64(y / z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -x / z; tmp = 0.0; if (z <= -1.0) tmp = x; elseif (z <= -1.05e-153) tmp = t_0; elseif (z <= -6.8e-197) tmp = y / z; elseif (z <= 6e-200) tmp = t_0; elseif (z <= 4.8e-152) tmp = y / z; elseif (z <= 4.5e-91) tmp = t_0; elseif (z <= 10500000000.0) tmp = y / z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[((-x) / z), $MachinePrecision]}, If[LessEqual[z, -1.0], x, If[LessEqual[z, -1.05e-153], t$95$0, If[LessEqual[z, -6.8e-197], N[(y / z), $MachinePrecision], If[LessEqual[z, 6e-200], t$95$0, If[LessEqual[z, 4.8e-152], N[(y / z), $MachinePrecision], If[LessEqual[z, 4.5e-91], t$95$0, If[LessEqual[z, 10500000000.0], N[(y / z), $MachinePrecision], x]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-153}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-197}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-200}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-152}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-91}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 10500000000:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1 or 1.05e10 < z Initial program 100.0%
div-sub100.0%
associate-+r-100.0%
remove-double-neg100.0%
distribute-frac-neg100.0%
unsub-neg100.0%
associate--r+100.0%
+-commutative100.0%
distribute-frac-neg100.0%
sub-neg100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around inf 67.8%
if -1 < z < -1.05000000000000002e-153 or -6.7999999999999996e-197 < z < 5.99999999999999989e-200 or 4.8e-152 < z < 4.49999999999999976e-91Initial program 100.0%
div-sub95.2%
associate-+r-95.2%
remove-double-neg95.2%
distribute-frac-neg95.2%
unsub-neg95.2%
associate--r+95.2%
+-commutative95.2%
distribute-frac-neg95.2%
sub-neg95.2%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around inf 71.9%
Taylor expanded in z around 0 71.5%
mul-1-neg71.5%
distribute-frac-neg71.5%
Simplified71.5%
if -1.05000000000000002e-153 < z < -6.7999999999999996e-197 or 5.99999999999999989e-200 < z < 4.8e-152 or 4.49999999999999976e-91 < z < 1.05e10Initial program 99.9%
div-sub96.0%
associate-+r-96.0%
remove-double-neg96.0%
distribute-frac-neg96.0%
unsub-neg96.0%
associate--r+96.0%
+-commutative96.0%
distribute-frac-neg96.0%
sub-neg96.0%
div-sub99.9%
Simplified99.9%
Taylor expanded in x around 0 71.3%
Final simplification69.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ y z))) (t_1 (/ (- x) z)))
(if (<= z -1.35e-43)
t_0
(if (<= z -7.2e-154)
t_1
(if (<= z -9.8e-199)
(/ y z)
(if (<= z 8.6e-198)
t_1
(if (<= z 1.35e-148) (/ y z) (if (<= z 9e-93) t_1 t_0))))))))
double code(double x, double y, double z) {
double t_0 = x + (y / z);
double t_1 = -x / z;
double tmp;
if (z <= -1.35e-43) {
tmp = t_0;
} else if (z <= -7.2e-154) {
tmp = t_1;
} else if (z <= -9.8e-199) {
tmp = y / z;
} else if (z <= 8.6e-198) {
tmp = t_1;
} else if (z <= 1.35e-148) {
tmp = y / z;
} else if (z <= 9e-93) {
tmp = t_1;
} else {
tmp = t_0;
}
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) :: t_1
real(8) :: tmp
t_0 = x + (y / z)
t_1 = -x / z
if (z <= (-1.35d-43)) then
tmp = t_0
else if (z <= (-7.2d-154)) then
tmp = t_1
else if (z <= (-9.8d-199)) then
tmp = y / z
else if (z <= 8.6d-198) then
tmp = t_1
else if (z <= 1.35d-148) then
tmp = y / z
else if (z <= 9d-93) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y / z);
double t_1 = -x / z;
double tmp;
if (z <= -1.35e-43) {
tmp = t_0;
} else if (z <= -7.2e-154) {
tmp = t_1;
} else if (z <= -9.8e-199) {
tmp = y / z;
} else if (z <= 8.6e-198) {
tmp = t_1;
} else if (z <= 1.35e-148) {
tmp = y / z;
} else if (z <= 9e-93) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (y / z) t_1 = -x / z tmp = 0 if z <= -1.35e-43: tmp = t_0 elif z <= -7.2e-154: tmp = t_1 elif z <= -9.8e-199: tmp = y / z elif z <= 8.6e-198: tmp = t_1 elif z <= 1.35e-148: tmp = y / z elif z <= 9e-93: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y / z)) t_1 = Float64(Float64(-x) / z) tmp = 0.0 if (z <= -1.35e-43) tmp = t_0; elseif (z <= -7.2e-154) tmp = t_1; elseif (z <= -9.8e-199) tmp = Float64(y / z); elseif (z <= 8.6e-198) tmp = t_1; elseif (z <= 1.35e-148) tmp = Float64(y / z); elseif (z <= 9e-93) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y / z); t_1 = -x / z; tmp = 0.0; if (z <= -1.35e-43) tmp = t_0; elseif (z <= -7.2e-154) tmp = t_1; elseif (z <= -9.8e-199) tmp = y / z; elseif (z <= 8.6e-198) tmp = t_1; elseif (z <= 1.35e-148) tmp = y / z; elseif (z <= 9e-93) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / z), $MachinePrecision]}, If[LessEqual[z, -1.35e-43], t$95$0, If[LessEqual[z, -7.2e-154], t$95$1, If[LessEqual[z, -9.8e-199], N[(y / z), $MachinePrecision], If[LessEqual[z, 8.6e-198], t$95$1, If[LessEqual[z, 1.35e-148], N[(y / z), $MachinePrecision], If[LessEqual[z, 9e-93], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{y}{z}\\
t_1 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{-43}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{-199}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-148}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-93}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.34999999999999996e-43 or 9.0000000000000004e-93 < z Initial program 100.0%
div-sub100.0%
associate-+r-100.0%
remove-double-neg100.0%
distribute-frac-neg100.0%
unsub-neg100.0%
associate--r+100.0%
+-commutative100.0%
distribute-frac-neg100.0%
sub-neg100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 91.7%
neg-mul-191.7%
distribute-neg-frac91.7%
Simplified91.7%
Taylor expanded in x around 0 91.7%
+-commutative91.7%
Simplified91.7%
if -1.34999999999999996e-43 < z < -7.2000000000000006e-154 or -9.8e-199 < z < 8.6000000000000007e-198 or 1.34999999999999994e-148 < z < 9.0000000000000004e-93Initial program 100.0%
div-sub94.7%
associate-+r-94.7%
remove-double-neg94.7%
distribute-frac-neg94.7%
unsub-neg94.7%
associate--r+94.7%
+-commutative94.7%
distribute-frac-neg94.7%
sub-neg94.7%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around inf 75.2%
Taylor expanded in z around 0 75.2%
mul-1-neg75.2%
distribute-frac-neg75.2%
Simplified75.2%
if -7.2000000000000006e-154 < z < -9.8e-199 or 8.6000000000000007e-198 < z < 1.34999999999999994e-148Initial program 100.0%
div-sub92.3%
associate-+r-92.3%
remove-double-neg92.3%
distribute-frac-neg92.3%
unsub-neg92.3%
associate--r+92.3%
+-commutative92.3%
distribute-frac-neg92.3%
sub-neg92.3%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 77.9%
Final simplification85.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -38000000000000.0) (not (<= x 0.21))) (- x (/ x z)) (+ x (/ y z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -38000000000000.0) || !(x <= 0.21)) {
tmp = x - (x / z);
} else {
tmp = x + (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 ((x <= (-38000000000000.0d0)) .or. (.not. (x <= 0.21d0))) then
tmp = x - (x / z)
else
tmp = x + (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -38000000000000.0) || !(x <= 0.21)) {
tmp = x - (x / z);
} else {
tmp = x + (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -38000000000000.0) or not (x <= 0.21): tmp = x - (x / z) else: tmp = x + (y / z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -38000000000000.0) || !(x <= 0.21)) tmp = Float64(x - Float64(x / z)); else tmp = Float64(x + Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -38000000000000.0) || ~((x <= 0.21))) tmp = x - (x / z); else tmp = x + (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -38000000000000.0], N[Not[LessEqual[x, 0.21]], $MachinePrecision]], N[(x - N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -38000000000000 \lor \neg \left(x \leq 0.21\right):\\
\;\;\;\;x - \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z}\\
\end{array}
\end{array}
if x < -3.8e13 or 0.209999999999999992 < x Initial program 100.0%
div-sub95.5%
associate-+r-95.5%
remove-double-neg95.5%
distribute-frac-neg95.5%
unsub-neg95.5%
associate--r+95.5%
+-commutative95.5%
distribute-frac-neg95.5%
sub-neg95.5%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around inf 88.5%
if -3.8e13 < x < 0.209999999999999992Initial program 100.0%
div-sub100.0%
associate-+r-100.0%
remove-double-neg100.0%
distribute-frac-neg100.0%
unsub-neg100.0%
associate--r+100.0%
+-commutative100.0%
distribute-frac-neg100.0%
sub-neg100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 87.0%
neg-mul-187.0%
distribute-neg-frac87.0%
Simplified87.0%
Taylor expanded in x around 0 87.0%
+-commutative87.0%
Simplified87.0%
Final simplification87.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.205))) (+ x (/ y z)) (/ (- y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.205)) {
tmp = x + (y / z);
} else {
tmp = (y - x) / 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.0d0)) .or. (.not. (z <= 0.205d0))) then
tmp = x + (y / z)
else
tmp = (y - x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.205)) {
tmp = x + (y / z);
} else {
tmp = (y - x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 0.205): tmp = x + (y / z) else: tmp = (y - x) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 0.205)) tmp = Float64(x + Float64(y / z)); else tmp = Float64(Float64(y - x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 0.205))) tmp = x + (y / z); else tmp = (y - x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 0.205]], $MachinePrecision]], N[(x + N[(y / z), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.205\right):\\
\;\;\;\;x + \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{z}\\
\end{array}
\end{array}
if z < -1 or 0.204999999999999988 < z Initial program 100.0%
div-sub100.0%
associate-+r-100.0%
remove-double-neg100.0%
distribute-frac-neg100.0%
unsub-neg100.0%
associate--r+100.0%
+-commutative100.0%
distribute-frac-neg100.0%
sub-neg100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 99.1%
neg-mul-199.1%
distribute-neg-frac99.1%
Simplified99.1%
Taylor expanded in x around 0 99.1%
+-commutative99.1%
Simplified99.1%
if -1 < z < 0.204999999999999988Initial program 100.0%
div-sub95.4%
associate-+r-95.4%
remove-double-neg95.4%
distribute-frac-neg95.4%
unsub-neg95.4%
associate--r+95.4%
+-commutative95.4%
distribute-frac-neg95.4%
sub-neg95.4%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around 0 99.4%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (<= z -8.6e+14) x (if (<= z 22000000000.0) (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -8.6e+14) {
tmp = x;
} else if (z <= 22000000000.0) {
tmp = y / z;
} else {
tmp = x;
}
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.6d+14)) then
tmp = x
else if (z <= 22000000000.0d0) then
tmp = y / z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -8.6e+14) {
tmp = x;
} else if (z <= 22000000000.0) {
tmp = y / z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -8.6e+14: tmp = x elif z <= 22000000000.0: tmp = y / z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -8.6e+14) tmp = x; elseif (z <= 22000000000.0) tmp = Float64(y / z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -8.6e+14) tmp = x; elseif (z <= 22000000000.0) tmp = y / z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -8.6e+14], x, If[LessEqual[z, 22000000000.0], N[(y / z), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 22000000000:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.6e14 or 2.2e10 < z Initial program 100.0%
div-sub100.0%
associate-+r-100.0%
remove-double-neg100.0%
distribute-frac-neg100.0%
unsub-neg100.0%
associate--r+100.0%
+-commutative100.0%
distribute-frac-neg100.0%
sub-neg100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around inf 69.2%
if -8.6e14 < z < 2.2e10Initial program 100.0%
div-sub95.6%
associate-+r-95.6%
remove-double-neg95.6%
distribute-frac-neg95.6%
unsub-neg95.6%
associate--r+95.6%
+-commutative95.6%
distribute-frac-neg95.6%
sub-neg95.6%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 48.5%
Final simplification58.0%
(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%
div-sub97.7%
associate-+r-97.7%
remove-double-neg97.7%
distribute-frac-neg97.7%
unsub-neg97.7%
associate--r+97.7%
+-commutative97.7%
distribute-frac-neg97.7%
sub-neg97.7%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around inf 33.9%
Final simplification33.9%
herbie shell --seed 2024020
(FPCore (x y z)
:name "Statistics.Sample:$swelfordMean from math-functions-0.1.5.2"
:precision binary64
(+ x (/ (- y x) z)))