
(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%
(FPCore (x y z)
:precision binary64
(if (<= z -3.3e+210)
x
(if (or (<= z -8e+145)
(and (not (<= z -3.5e+47))
(or (<= z 1.3e-38)
(and (not (<= z 7.5e+35))
(or (<= z 1.85e+56)
(and (not (<= z 9e+192)) (<= z 9.2e+192)))))))
(/ y z)
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.3e+210) {
tmp = x;
} else if ((z <= -8e+145) || (!(z <= -3.5e+47) && ((z <= 1.3e-38) || (!(z <= 7.5e+35) && ((z <= 1.85e+56) || (!(z <= 9e+192) && (z <= 9.2e+192))))))) {
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 <= (-3.3d+210)) then
tmp = x
else if ((z <= (-8d+145)) .or. (.not. (z <= (-3.5d+47))) .and. (z <= 1.3d-38) .or. (.not. (z <= 7.5d+35)) .and. (z <= 1.85d+56) .or. (.not. (z <= 9d+192)) .and. (z <= 9.2d+192)) 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 <= -3.3e+210) {
tmp = x;
} else if ((z <= -8e+145) || (!(z <= -3.5e+47) && ((z <= 1.3e-38) || (!(z <= 7.5e+35) && ((z <= 1.85e+56) || (!(z <= 9e+192) && (z <= 9.2e+192))))))) {
tmp = y / z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.3e+210: tmp = x elif (z <= -8e+145) or (not (z <= -3.5e+47) and ((z <= 1.3e-38) or (not (z <= 7.5e+35) and ((z <= 1.85e+56) or (not (z <= 9e+192) and (z <= 9.2e+192)))))): tmp = y / z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.3e+210) tmp = x; elseif ((z <= -8e+145) || (!(z <= -3.5e+47) && ((z <= 1.3e-38) || (!(z <= 7.5e+35) && ((z <= 1.85e+56) || (!(z <= 9e+192) && (z <= 9.2e+192))))))) tmp = Float64(y / z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.3e+210) tmp = x; elseif ((z <= -8e+145) || (~((z <= -3.5e+47)) && ((z <= 1.3e-38) || (~((z <= 7.5e+35)) && ((z <= 1.85e+56) || (~((z <= 9e+192)) && (z <= 9.2e+192))))))) tmp = y / z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.3e+210], x, If[Or[LessEqual[z, -8e+145], And[N[Not[LessEqual[z, -3.5e+47]], $MachinePrecision], Or[LessEqual[z, 1.3e-38], And[N[Not[LessEqual[z, 7.5e+35]], $MachinePrecision], Or[LessEqual[z, 1.85e+56], And[N[Not[LessEqual[z, 9e+192]], $MachinePrecision], LessEqual[z, 9.2e+192]]]]]]], N[(y / z), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+210}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -8 \cdot 10^{+145} \lor \neg \left(z \leq -3.5 \cdot 10^{+47}\right) \land \left(z \leq 1.3 \cdot 10^{-38} \lor \neg \left(z \leq 7.5 \cdot 10^{+35}\right) \land \left(z \leq 1.85 \cdot 10^{+56} \lor \neg \left(z \leq 9 \cdot 10^{+192}\right) \land z \leq 9.2 \cdot 10^{+192}\right)\right):\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.29999999999999995e210 or -7.9999999999999999e145 < z < -3.50000000000000015e47 or 1.30000000000000005e-38 < z < 7.4999999999999999e35 or 1.84999999999999998e56 < z < 9e192 or 9.1999999999999997e192 < z Initial program 100.0%
div-sub100.0%
sub-neg100.0%
distribute-frac-neg100.0%
+-commutative100.0%
associate-+r+100.0%
distribute-frac-neg100.0%
sub-neg100.0%
associate--r-100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around inf 74.8%
if -3.29999999999999995e210 < z < -7.9999999999999999e145 or -3.50000000000000015e47 < z < 1.30000000000000005e-38 or 7.4999999999999999e35 < z < 1.84999999999999998e56 or 9e192 < z < 9.1999999999999997e192Initial program 100.0%
div-sub97.5%
sub-neg97.5%
distribute-frac-neg97.5%
+-commutative97.5%
associate-+r+97.5%
distribute-frac-neg97.5%
sub-neg97.5%
associate--r-97.5%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 50.1%
Final simplification59.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ x (- z))))
(if (<= z -3.3e+210)
x
(if (<= z -8e+145)
(/ y z)
(if (<= z -1.65e+21)
x
(if (<= z -1.1e-56)
(/ y z)
(if (<= z 2.3e-151)
t_0
(if (<= z 2.4e-54) (/ y z) (if (<= z 9.8e-26) t_0 x)))))))))
double code(double x, double y, double z) {
double t_0 = x / -z;
double tmp;
if (z <= -3.3e+210) {
tmp = x;
} else if (z <= -8e+145) {
tmp = y / z;
} else if (z <= -1.65e+21) {
tmp = x;
} else if (z <= -1.1e-56) {
tmp = y / z;
} else if (z <= 2.3e-151) {
tmp = t_0;
} else if (z <= 2.4e-54) {
tmp = y / z;
} else if (z <= 9.8e-26) {
tmp = t_0;
} 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 <= (-3.3d+210)) then
tmp = x
else if (z <= (-8d+145)) then
tmp = y / z
else if (z <= (-1.65d+21)) then
tmp = x
else if (z <= (-1.1d-56)) then
tmp = y / z
else if (z <= 2.3d-151) then
tmp = t_0
else if (z <= 2.4d-54) then
tmp = y / z
else if (z <= 9.8d-26) then
tmp = t_0
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 <= -3.3e+210) {
tmp = x;
} else if (z <= -8e+145) {
tmp = y / z;
} else if (z <= -1.65e+21) {
tmp = x;
} else if (z <= -1.1e-56) {
tmp = y / z;
} else if (z <= 2.3e-151) {
tmp = t_0;
} else if (z <= 2.4e-54) {
tmp = y / z;
} else if (z <= 9.8e-26) {
tmp = t_0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = x / -z tmp = 0 if z <= -3.3e+210: tmp = x elif z <= -8e+145: tmp = y / z elif z <= -1.65e+21: tmp = x elif z <= -1.1e-56: tmp = y / z elif z <= 2.3e-151: tmp = t_0 elif z <= 2.4e-54: tmp = y / z elif z <= 9.8e-26: tmp = t_0 else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(x / Float64(-z)) tmp = 0.0 if (z <= -3.3e+210) tmp = x; elseif (z <= -8e+145) tmp = Float64(y / z); elseif (z <= -1.65e+21) tmp = x; elseif (z <= -1.1e-56) tmp = Float64(y / z); elseif (z <= 2.3e-151) tmp = t_0; elseif (z <= 2.4e-54) tmp = Float64(y / z); elseif (z <= 9.8e-26) tmp = t_0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x / -z; tmp = 0.0; if (z <= -3.3e+210) tmp = x; elseif (z <= -8e+145) tmp = y / z; elseif (z <= -1.65e+21) tmp = x; elseif (z <= -1.1e-56) tmp = y / z; elseif (z <= 2.3e-151) tmp = t_0; elseif (z <= 2.4e-54) tmp = y / z; elseif (z <= 9.8e-26) tmp = t_0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x / (-z)), $MachinePrecision]}, If[LessEqual[z, -3.3e+210], x, If[LessEqual[z, -8e+145], N[(y / z), $MachinePrecision], If[LessEqual[z, -1.65e+21], x, If[LessEqual[z, -1.1e-56], N[(y / z), $MachinePrecision], If[LessEqual[z, 2.3e-151], t$95$0, If[LessEqual[z, 2.4e-54], N[(y / z), $MachinePrecision], If[LessEqual[z, 9.8e-26], t$95$0, x]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{-z}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+210}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -8 \cdot 10^{+145}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{+21}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-56}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-151}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-54}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-26}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.29999999999999995e210 or -7.9999999999999999e145 < z < -1.65e21 or 9.7999999999999998e-26 < z Initial program 100.0%
div-sub100.0%
sub-neg100.0%
distribute-frac-neg100.0%
+-commutative100.0%
associate-+r+100.0%
distribute-frac-neg100.0%
sub-neg100.0%
associate--r-100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around inf 75.5%
if -3.29999999999999995e210 < z < -7.9999999999999999e145 or -1.65e21 < z < -1.10000000000000002e-56 or 2.29999999999999996e-151 < z < 2.40000000000000013e-54Initial program 100.0%
div-sub100.0%
sub-neg100.0%
distribute-frac-neg100.0%
+-commutative100.0%
associate-+r+100.0%
distribute-frac-neg100.0%
sub-neg100.0%
associate--r-100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 63.9%
if -1.10000000000000002e-56 < z < 2.29999999999999996e-151 or 2.40000000000000013e-54 < z < 9.7999999999999998e-26Initial program 100.0%
div-sub96.1%
sub-neg96.1%
distribute-frac-neg96.1%
+-commutative96.1%
associate-+r+96.1%
distribute-frac-neg96.1%
sub-neg96.1%
associate--r-96.1%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in y around 0 66.0%
mul-1-neg66.0%
distribute-frac-neg66.0%
Simplified66.0%
Final simplification69.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.06e+225) (and (not (<= x 2.3e+34)) (<= x 3.4e+121))) (/ x (- z)) (+ x (/ y z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.06e+225) || (!(x <= 2.3e+34) && (x <= 3.4e+121))) {
tmp = 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 <= (-1.06d+225)) .or. (.not. (x <= 2.3d+34)) .and. (x <= 3.4d+121)) then
tmp = 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 <= -1.06e+225) || (!(x <= 2.3e+34) && (x <= 3.4e+121))) {
tmp = x / -z;
} else {
tmp = x + (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.06e+225) or (not (x <= 2.3e+34) and (x <= 3.4e+121)): tmp = x / -z else: tmp = x + (y / z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.06e+225) || (!(x <= 2.3e+34) && (x <= 3.4e+121))) tmp = Float64(x / Float64(-z)); else tmp = Float64(x + Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.06e+225) || (~((x <= 2.3e+34)) && (x <= 3.4e+121))) tmp = x / -z; else tmp = x + (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.06e+225], And[N[Not[LessEqual[x, 2.3e+34]], $MachinePrecision], LessEqual[x, 3.4e+121]]], N[(x / (-z)), $MachinePrecision], N[(x + N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{+225} \lor \neg \left(x \leq 2.3 \cdot 10^{+34}\right) \land x \leq 3.4 \cdot 10^{+121}:\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z}\\
\end{array}
\end{array}
if x < -1.06e225 or 2.2999999999999998e34 < x < 3.4000000000000001e121Initial program 100.0%
div-sub94.9%
sub-neg94.9%
distribute-frac-neg94.9%
+-commutative94.9%
associate-+r+94.9%
distribute-frac-neg94.9%
sub-neg94.9%
associate--r-94.9%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around 0 77.6%
Taylor expanded in y around 0 67.6%
mul-1-neg67.6%
distribute-frac-neg67.6%
Simplified67.6%
if -1.06e225 < x < 2.2999999999999998e34 or 3.4000000000000001e121 < x Initial program 100.0%
div-sub99.1%
sub-neg99.1%
distribute-frac-neg99.1%
+-commutative99.1%
associate-+r+99.1%
distribute-frac-neg99.1%
sub-neg99.1%
associate--r-99.1%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 74.1%
neg-mul-174.1%
distribute-neg-frac274.1%
Simplified74.1%
Taylor expanded in x around 0 74.1%
cancel-sign-sub-inv74.1%
metadata-eval74.1%
*-lft-identity74.1%
+-commutative74.1%
Simplified74.1%
Final simplification73.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.8e+36) (not (<= z 9.8e-26))) (+ x (/ y z)) (/ (- y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.8e+36) || !(z <= 9.8e-26)) {
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 <= (-4.8d+36)) .or. (.not. (z <= 9.8d-26))) 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 <= -4.8e+36) || !(z <= 9.8e-26)) {
tmp = x + (y / z);
} else {
tmp = (y - x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.8e+36) or not (z <= 9.8e-26): tmp = x + (y / z) else: tmp = (y - x) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.8e+36) || !(z <= 9.8e-26)) 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 <= -4.8e+36) || ~((z <= 9.8e-26))) tmp = x + (y / z); else tmp = (y - x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.8e+36], N[Not[LessEqual[z, 9.8e-26]], $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 -4.8 \cdot 10^{+36} \lor \neg \left(z \leq 9.8 \cdot 10^{-26}\right):\\
\;\;\;\;x + \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{z}\\
\end{array}
\end{array}
if z < -4.79999999999999985e36 or 9.7999999999999998e-26 < z Initial program 100.0%
div-sub100.0%
sub-neg100.0%
distribute-frac-neg100.0%
+-commutative100.0%
associate-+r+100.0%
distribute-frac-neg100.0%
sub-neg100.0%
associate--r-100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 97.8%
neg-mul-197.8%
distribute-neg-frac297.8%
Simplified97.8%
Taylor expanded in x around 0 97.8%
cancel-sign-sub-inv97.8%
metadata-eval97.8%
*-lft-identity97.8%
+-commutative97.8%
Simplified97.8%
if -4.79999999999999985e36 < z < 9.7999999999999998e-26Initial program 100.0%
div-sub97.3%
sub-neg97.3%
distribute-frac-neg97.3%
+-commutative97.3%
associate-+r+97.3%
distribute-frac-neg97.3%
sub-neg97.3%
associate--r-97.3%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around 0 97.5%
Final simplification97.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -620000.0) (not (<= y 3.6e-33))) (+ x (/ y z)) (- x (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -620000.0) || !(y <= 3.6e-33)) {
tmp = x + (y / z);
} else {
tmp = x - (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 ((y <= (-620000.0d0)) .or. (.not. (y <= 3.6d-33))) then
tmp = x + (y / z)
else
tmp = x - (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -620000.0) || !(y <= 3.6e-33)) {
tmp = x + (y / z);
} else {
tmp = x - (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -620000.0) or not (y <= 3.6e-33): tmp = x + (y / z) else: tmp = x - (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -620000.0) || !(y <= 3.6e-33)) tmp = Float64(x + Float64(y / z)); else tmp = Float64(x - Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -620000.0) || ~((y <= 3.6e-33))) tmp = x + (y / z); else tmp = x - (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -620000.0], N[Not[LessEqual[y, 3.6e-33]], $MachinePrecision]], N[(x + N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x - N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -620000 \lor \neg \left(y \leq 3.6 \cdot 10^{-33}\right):\\
\;\;\;\;x + \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x}{z}\\
\end{array}
\end{array}
if y < -6.2e5 or 3.60000000000000034e-33 < y Initial program 100.0%
div-sub97.0%
sub-neg97.0%
distribute-frac-neg97.0%
+-commutative97.0%
associate-+r+97.0%
distribute-frac-neg97.0%
sub-neg97.0%
associate--r-97.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 84.0%
neg-mul-184.0%
distribute-neg-frac284.0%
Simplified84.0%
Taylor expanded in x around 0 84.0%
cancel-sign-sub-inv84.0%
metadata-eval84.0%
*-lft-identity84.0%
+-commutative84.0%
Simplified84.0%
if -6.2e5 < y < 3.60000000000000034e-33Initial program 100.0%
div-sub100.0%
sub-neg100.0%
distribute-frac-neg100.0%
+-commutative100.0%
associate-+r+100.0%
distribute-frac-neg100.0%
sub-neg100.0%
associate--r-100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around inf 83.8%
Final simplification83.9%
(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-sub98.4%
sub-neg98.4%
distribute-frac-neg98.4%
+-commutative98.4%
associate-+r+98.4%
distribute-frac-neg98.4%
sub-neg98.4%
associate--r-98.4%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around inf 32.8%
herbie shell --seed 2024107
(FPCore (x y z)
:name "Statistics.Sample:$swelfordMean from math-functions-0.1.5.2"
:precision binary64
(+ x (/ (- y x) z)))