
(FPCore (x y z) :precision binary64 (- (+ (- x (* (+ y 0.5) (log y))) y) z))
double code(double x, double y, double z) {
return ((x - ((y + 0.5) * log(y))) + 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 - ((y + 0.5d0) * log(y))) + y) - z
end function
public static double code(double x, double y, double z) {
return ((x - ((y + 0.5) * Math.log(y))) + y) - z;
}
def code(x, y, z): return ((x - ((y + 0.5) * math.log(y))) + y) - z
function code(x, y, z) return Float64(Float64(Float64(x - Float64(Float64(y + 0.5) * log(y))) + y) - z) end
function tmp = code(x, y, z) tmp = ((x - ((y + 0.5) * log(y))) + y) - z; end
code[x_, y_, z_] := N[(N[(N[(x - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (- (+ (- x (* (+ y 0.5) (log y))) y) z))
double code(double x, double y, double z) {
return ((x - ((y + 0.5) * log(y))) + 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 - ((y + 0.5d0) * log(y))) + y) - z
end function
public static double code(double x, double y, double z) {
return ((x - ((y + 0.5) * Math.log(y))) + y) - z;
}
def code(x, y, z): return ((x - ((y + 0.5) * math.log(y))) + y) - z
function code(x, y, z) return Float64(Float64(Float64(x - Float64(Float64(y + 0.5) * log(y))) + y) - z) end
function tmp = code(x, y, z) tmp = ((x - ((y + 0.5) * log(y))) + y) - z; end
code[x_, y_, z_] := N[(N[(N[(x - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\end{array}
(FPCore (x y z) :precision binary64 (- (- (+ x (* y (- 1.0 (log y)))) (* (log y) 0.5)) z))
double code(double x, double y, double z) {
return ((x + (y * (1.0 - log(y)))) - (log(y) * 0.5)) - 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 - log(y)))) - (log(y) * 0.5d0)) - z
end function
public static double code(double x, double y, double z) {
return ((x + (y * (1.0 - Math.log(y)))) - (Math.log(y) * 0.5)) - z;
}
def code(x, y, z): return ((x + (y * (1.0 - math.log(y)))) - (math.log(y) * 0.5)) - z
function code(x, y, z) return Float64(Float64(Float64(x + Float64(y * Float64(1.0 - log(y)))) - Float64(log(y) * 0.5)) - z) end
function tmp = code(x, y, z) tmp = ((x + (y * (1.0 - log(y)))) - (log(y) * 0.5)) - z; end
code[x_, y_, z_] := N[(N[(N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot \left(1 - \log y\right)\right) - \log y \cdot 0.5\right) - z
\end{array}
Initial program 99.8%
Taylor expanded in y around 0 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (+ x (- (fma (log y) (- -0.5 y) y) z)))
double code(double x, double y, double z) {
return x + (fma(log(y), (-0.5 - y), y) - z);
}
function code(x, y, z) return Float64(x + Float64(fma(log(y), Float64(-0.5 - y), y) - z)) end
code[x_, y_, z_] := N[(x + N[(N[(N[Log[y], $MachinePrecision] * N[(-0.5 - y), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\mathsf{fma}\left(\log y, -0.5 - y, y\right) - z\right)
\end{array}
Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
associate-+l+99.8%
associate-+r-99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- y (* (log y) (+ y 0.5)))) (t_1 (+ x (* y (- 1.0 (log y))))))
(if (<= z -8.2e+106)
(- x z)
(if (<= z -2.7e-139)
t_1
(if (<= z -2.7e-258)
t_0
(if (<= z 1.6e-299)
(+ x (* (log y) -0.5))
(if (<= z 4.5e-135) t_0 (if (<= z 4e+48) t_1 (- x z)))))))))
double code(double x, double y, double z) {
double t_0 = y - (log(y) * (y + 0.5));
double t_1 = x + (y * (1.0 - log(y)));
double tmp;
if (z <= -8.2e+106) {
tmp = x - z;
} else if (z <= -2.7e-139) {
tmp = t_1;
} else if (z <= -2.7e-258) {
tmp = t_0;
} else if (z <= 1.6e-299) {
tmp = x + (log(y) * -0.5);
} else if (z <= 4.5e-135) {
tmp = t_0;
} else if (z <= 4e+48) {
tmp = t_1;
} else {
tmp = 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y - (log(y) * (y + 0.5d0))
t_1 = x + (y * (1.0d0 - log(y)))
if (z <= (-8.2d+106)) then
tmp = x - z
else if (z <= (-2.7d-139)) then
tmp = t_1
else if (z <= (-2.7d-258)) then
tmp = t_0
else if (z <= 1.6d-299) then
tmp = x + (log(y) * (-0.5d0))
else if (z <= 4.5d-135) then
tmp = t_0
else if (z <= 4d+48) then
tmp = t_1
else
tmp = x - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y - (Math.log(y) * (y + 0.5));
double t_1 = x + (y * (1.0 - Math.log(y)));
double tmp;
if (z <= -8.2e+106) {
tmp = x - z;
} else if (z <= -2.7e-139) {
tmp = t_1;
} else if (z <= -2.7e-258) {
tmp = t_0;
} else if (z <= 1.6e-299) {
tmp = x + (Math.log(y) * -0.5);
} else if (z <= 4.5e-135) {
tmp = t_0;
} else if (z <= 4e+48) {
tmp = t_1;
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): t_0 = y - (math.log(y) * (y + 0.5)) t_1 = x + (y * (1.0 - math.log(y))) tmp = 0 if z <= -8.2e+106: tmp = x - z elif z <= -2.7e-139: tmp = t_1 elif z <= -2.7e-258: tmp = t_0 elif z <= 1.6e-299: tmp = x + (math.log(y) * -0.5) elif z <= 4.5e-135: tmp = t_0 elif z <= 4e+48: tmp = t_1 else: tmp = x - z return tmp
function code(x, y, z) t_0 = Float64(y - Float64(log(y) * Float64(y + 0.5))) t_1 = Float64(x + Float64(y * Float64(1.0 - log(y)))) tmp = 0.0 if (z <= -8.2e+106) tmp = Float64(x - z); elseif (z <= -2.7e-139) tmp = t_1; elseif (z <= -2.7e-258) tmp = t_0; elseif (z <= 1.6e-299) tmp = Float64(x + Float64(log(y) * -0.5)); elseif (z <= 4.5e-135) tmp = t_0; elseif (z <= 4e+48) tmp = t_1; else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y - (log(y) * (y + 0.5)); t_1 = x + (y * (1.0 - log(y))); tmp = 0.0; if (z <= -8.2e+106) tmp = x - z; elseif (z <= -2.7e-139) tmp = t_1; elseif (z <= -2.7e-258) tmp = t_0; elseif (z <= 1.6e-299) tmp = x + (log(y) * -0.5); elseif (z <= 4.5e-135) tmp = t_0; elseif (z <= 4e+48) tmp = t_1; else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y - N[(N[Log[y], $MachinePrecision] * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+106], N[(x - z), $MachinePrecision], If[LessEqual[z, -2.7e-139], t$95$1, If[LessEqual[z, -2.7e-258], t$95$0, If[LessEqual[z, 1.6e-299], N[(x + N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-135], t$95$0, If[LessEqual[z, 4e+48], t$95$1, N[(x - z), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y - \log y \cdot \left(y + 0.5\right)\\
t_1 := x + y \cdot \left(1 - \log y\right)\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+106}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-258}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-299}:\\
\;\;\;\;x + \log y \cdot -0.5\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-135}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -8.2000000000000005e106 or 4.00000000000000018e48 < z Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 87.0%
if -8.2000000000000005e106 < z < -2.6999999999999998e-139 or 4.49999999999999987e-135 < z < 4.00000000000000018e48Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 94.9%
Taylor expanded in y around inf 81.2%
mul-1-neg81.2%
log-rec81.2%
distribute-rgt-neg-out81.2%
remove-double-neg81.2%
Simplified81.2%
sub-neg81.2%
associate-+l+81.2%
sub-neg81.2%
*-un-lft-identity81.2%
*-commutative81.2%
distribute-rgt-out--81.3%
+-commutative81.3%
Applied egg-rr81.3%
if -2.6999999999999998e-139 < z < -2.69999999999999996e-258 or 1.60000000000000004e-299 < z < 4.49999999999999987e-135Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 81.9%
if -2.69999999999999996e-258 < z < 1.60000000000000004e-299Initial program 99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
+-commutative99.9%
rem-cube-cbrt98.7%
Applied egg-rr98.7%
Taylor expanded in y around 0 83.5%
sub-neg83.5%
*-commutative83.5%
pow-base-183.5%
*-lft-identity83.5%
distribute-rgt-neg-in83.5%
metadata-eval83.5%
Simplified83.5%
Final simplification84.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- y (* (log y) (+ y 0.5))))
(t_1 (* y (- 1.0 (log y))))
(t_2 (+ x t_1)))
(if (<= z -2.4e+107)
(- t_1 z)
(if (<= z -3.1e-139)
t_2
(if (<= z -1.6e-258)
t_0
(if (<= z 1.65e-299)
(+ x (* (log y) -0.5))
(if (<= z 1.3e-135) t_0 (if (<= z 1.65e+48) t_2 (- x z)))))))))
double code(double x, double y, double z) {
double t_0 = y - (log(y) * (y + 0.5));
double t_1 = y * (1.0 - log(y));
double t_2 = x + t_1;
double tmp;
if (z <= -2.4e+107) {
tmp = t_1 - z;
} else if (z <= -3.1e-139) {
tmp = t_2;
} else if (z <= -1.6e-258) {
tmp = t_0;
} else if (z <= 1.65e-299) {
tmp = x + (log(y) * -0.5);
} else if (z <= 1.3e-135) {
tmp = t_0;
} else if (z <= 1.65e+48) {
tmp = t_2;
} else {
tmp = 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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = y - (log(y) * (y + 0.5d0))
t_1 = y * (1.0d0 - log(y))
t_2 = x + t_1
if (z <= (-2.4d+107)) then
tmp = t_1 - z
else if (z <= (-3.1d-139)) then
tmp = t_2
else if (z <= (-1.6d-258)) then
tmp = t_0
else if (z <= 1.65d-299) then
tmp = x + (log(y) * (-0.5d0))
else if (z <= 1.3d-135) then
tmp = t_0
else if (z <= 1.65d+48) then
tmp = t_2
else
tmp = x - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y - (Math.log(y) * (y + 0.5));
double t_1 = y * (1.0 - Math.log(y));
double t_2 = x + t_1;
double tmp;
if (z <= -2.4e+107) {
tmp = t_1 - z;
} else if (z <= -3.1e-139) {
tmp = t_2;
} else if (z <= -1.6e-258) {
tmp = t_0;
} else if (z <= 1.65e-299) {
tmp = x + (Math.log(y) * -0.5);
} else if (z <= 1.3e-135) {
tmp = t_0;
} else if (z <= 1.65e+48) {
tmp = t_2;
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): t_0 = y - (math.log(y) * (y + 0.5)) t_1 = y * (1.0 - math.log(y)) t_2 = x + t_1 tmp = 0 if z <= -2.4e+107: tmp = t_1 - z elif z <= -3.1e-139: tmp = t_2 elif z <= -1.6e-258: tmp = t_0 elif z <= 1.65e-299: tmp = x + (math.log(y) * -0.5) elif z <= 1.3e-135: tmp = t_0 elif z <= 1.65e+48: tmp = t_2 else: tmp = x - z return tmp
function code(x, y, z) t_0 = Float64(y - Float64(log(y) * Float64(y + 0.5))) t_1 = Float64(y * Float64(1.0 - log(y))) t_2 = Float64(x + t_1) tmp = 0.0 if (z <= -2.4e+107) tmp = Float64(t_1 - z); elseif (z <= -3.1e-139) tmp = t_2; elseif (z <= -1.6e-258) tmp = t_0; elseif (z <= 1.65e-299) tmp = Float64(x + Float64(log(y) * -0.5)); elseif (z <= 1.3e-135) tmp = t_0; elseif (z <= 1.65e+48) tmp = t_2; else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y - (log(y) * (y + 0.5)); t_1 = y * (1.0 - log(y)); t_2 = x + t_1; tmp = 0.0; if (z <= -2.4e+107) tmp = t_1 - z; elseif (z <= -3.1e-139) tmp = t_2; elseif (z <= -1.6e-258) tmp = t_0; elseif (z <= 1.65e-299) tmp = x + (log(y) * -0.5); elseif (z <= 1.3e-135) tmp = t_0; elseif (z <= 1.65e+48) tmp = t_2; else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y - N[(N[Log[y], $MachinePrecision] * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + t$95$1), $MachinePrecision]}, If[LessEqual[z, -2.4e+107], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[z, -3.1e-139], t$95$2, If[LessEqual[z, -1.6e-258], t$95$0, If[LessEqual[z, 1.65e-299], N[(x + N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-135], t$95$0, If[LessEqual[z, 1.65e+48], t$95$2, N[(x - z), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y - \log y \cdot \left(y + 0.5\right)\\
t_1 := y \cdot \left(1 - \log y\right)\\
t_2 := x + t\_1\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+107}:\\
\;\;\;\;t\_1 - z\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-139}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-258}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-299}:\\
\;\;\;\;x + \log y \cdot -0.5\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-135}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -2.4000000000000001e107Initial program 99.9%
flip-+73.3%
associate-*l/73.3%
fma-neg73.3%
metadata-eval73.3%
metadata-eval73.3%
sub-neg73.3%
metadata-eval73.3%
Applied egg-rr73.3%
Taylor expanded in y around inf 92.9%
mul-1-neg92.9%
log-rec92.9%
remove-double-neg92.9%
Simplified92.9%
if -2.4000000000000001e107 < z < -3.0999999999999999e-139 or 1.30000000000000002e-135 < z < 1.65000000000000011e48Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 94.9%
Taylor expanded in y around inf 81.2%
mul-1-neg81.2%
log-rec81.2%
distribute-rgt-neg-out81.2%
remove-double-neg81.2%
Simplified81.2%
sub-neg81.2%
associate-+l+81.2%
sub-neg81.2%
*-un-lft-identity81.2%
*-commutative81.2%
distribute-rgt-out--81.3%
+-commutative81.3%
Applied egg-rr81.3%
if -3.0999999999999999e-139 < z < -1.6000000000000001e-258 or 1.6500000000000001e-299 < z < 1.30000000000000002e-135Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 81.9%
if -1.6000000000000001e-258 < z < 1.6500000000000001e-299Initial program 99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
+-commutative99.9%
rem-cube-cbrt98.7%
Applied egg-rr98.7%
Taylor expanded in y around 0 83.5%
sub-neg83.5%
*-commutative83.5%
pow-base-183.5%
*-lft-identity83.5%
distribute-rgt-neg-in83.5%
metadata-eval83.5%
Simplified83.5%
if 1.65000000000000011e48 < z Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 87.1%
Final simplification85.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* y (- 1.0 (log y))) z)) (t_1 (- (- x (* (log y) 0.5)) z)))
(if (<= y 9e+43)
t_1
(if (<= y 3.2e+79)
t_0
(if (<= y 1.32e+116)
t_1
(if (<= y 6.8e+151) (- (+ x y) (* y (log y))) t_0))))))
double code(double x, double y, double z) {
double t_0 = (y * (1.0 - log(y))) - z;
double t_1 = (x - (log(y) * 0.5)) - z;
double tmp;
if (y <= 9e+43) {
tmp = t_1;
} else if (y <= 3.2e+79) {
tmp = t_0;
} else if (y <= 1.32e+116) {
tmp = t_1;
} else if (y <= 6.8e+151) {
tmp = (x + y) - (y * log(y));
} 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 = (y * (1.0d0 - log(y))) - z
t_1 = (x - (log(y) * 0.5d0)) - z
if (y <= 9d+43) then
tmp = t_1
else if (y <= 3.2d+79) then
tmp = t_0
else if (y <= 1.32d+116) then
tmp = t_1
else if (y <= 6.8d+151) then
tmp = (x + y) - (y * log(y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y * (1.0 - Math.log(y))) - z;
double t_1 = (x - (Math.log(y) * 0.5)) - z;
double tmp;
if (y <= 9e+43) {
tmp = t_1;
} else if (y <= 3.2e+79) {
tmp = t_0;
} else if (y <= 1.32e+116) {
tmp = t_1;
} else if (y <= 6.8e+151) {
tmp = (x + y) - (y * Math.log(y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y * (1.0 - math.log(y))) - z t_1 = (x - (math.log(y) * 0.5)) - z tmp = 0 if y <= 9e+43: tmp = t_1 elif y <= 3.2e+79: tmp = t_0 elif y <= 1.32e+116: tmp = t_1 elif y <= 6.8e+151: tmp = (x + y) - (y * math.log(y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y * Float64(1.0 - log(y))) - z) t_1 = Float64(Float64(x - Float64(log(y) * 0.5)) - z) tmp = 0.0 if (y <= 9e+43) tmp = t_1; elseif (y <= 3.2e+79) tmp = t_0; elseif (y <= 1.32e+116) tmp = t_1; elseif (y <= 6.8e+151) tmp = Float64(Float64(x + y) - Float64(y * log(y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y * (1.0 - log(y))) - z; t_1 = (x - (log(y) * 0.5)) - z; tmp = 0.0; if (y <= 9e+43) tmp = t_1; elseif (y <= 3.2e+79) tmp = t_0; elseif (y <= 1.32e+116) tmp = t_1; elseif (y <= 6.8e+151) tmp = (x + y) - (y * log(y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[y, 9e+43], t$95$1, If[LessEqual[y, 3.2e+79], t$95$0, If[LessEqual[y, 1.32e+116], t$95$1, If[LessEqual[y, 6.8e+151], N[(N[(x + y), $MachinePrecision] - N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(1 - \log y\right) - z\\
t_1 := \left(x - \log y \cdot 0.5\right) - z\\
\mathbf{if}\;y \leq 9 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+79}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+151}:\\
\;\;\;\;\left(x + y\right) - y \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < 9e43 or 3.20000000000000003e79 < y < 1.32000000000000002e116Initial program 100.0%
Taylor expanded in y around 0 95.5%
if 9e43 < y < 3.20000000000000003e79 or 6.7999999999999999e151 < y Initial program 99.6%
flip-+29.0%
associate-*l/29.1%
fma-neg29.1%
metadata-eval29.1%
metadata-eval29.1%
sub-neg29.1%
metadata-eval29.1%
Applied egg-rr29.1%
Taylor expanded in y around inf 88.1%
mul-1-neg88.1%
log-rec88.1%
remove-double-neg88.1%
Simplified88.1%
if 1.32000000000000002e116 < y < 6.7999999999999999e151Initial program 99.5%
associate--l+99.6%
Simplified99.6%
Taylor expanded in z around 0 87.6%
Taylor expanded in y around inf 87.6%
mul-1-neg87.6%
log-rec87.6%
distribute-rgt-neg-out87.6%
remove-double-neg87.6%
Simplified87.6%
Final simplification92.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (log y) -0.5)))
(if (<= z -3e-139)
(- x z)
(if (<= z -2.5e-244)
t_0
(if (<= z -3.4e-296) x (if (<= z 6.7e-137) t_0 (- x z)))))))
double code(double x, double y, double z) {
double t_0 = log(y) * -0.5;
double tmp;
if (z <= -3e-139) {
tmp = x - z;
} else if (z <= -2.5e-244) {
tmp = t_0;
} else if (z <= -3.4e-296) {
tmp = x;
} else if (z <= 6.7e-137) {
tmp = t_0;
} else {
tmp = 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) :: t_0
real(8) :: tmp
t_0 = log(y) * (-0.5d0)
if (z <= (-3d-139)) then
tmp = x - z
else if (z <= (-2.5d-244)) then
tmp = t_0
else if (z <= (-3.4d-296)) then
tmp = x
else if (z <= 6.7d-137) then
tmp = t_0
else
tmp = x - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.log(y) * -0.5;
double tmp;
if (z <= -3e-139) {
tmp = x - z;
} else if (z <= -2.5e-244) {
tmp = t_0;
} else if (z <= -3.4e-296) {
tmp = x;
} else if (z <= 6.7e-137) {
tmp = t_0;
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): t_0 = math.log(y) * -0.5 tmp = 0 if z <= -3e-139: tmp = x - z elif z <= -2.5e-244: tmp = t_0 elif z <= -3.4e-296: tmp = x elif z <= 6.7e-137: tmp = t_0 else: tmp = x - z return tmp
function code(x, y, z) t_0 = Float64(log(y) * -0.5) tmp = 0.0 if (z <= -3e-139) tmp = Float64(x - z); elseif (z <= -2.5e-244) tmp = t_0; elseif (z <= -3.4e-296) tmp = x; elseif (z <= 6.7e-137) tmp = t_0; else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = log(y) * -0.5; tmp = 0.0; if (z <= -3e-139) tmp = x - z; elseif (z <= -2.5e-244) tmp = t_0; elseif (z <= -3.4e-296) tmp = x; elseif (z <= 6.7e-137) tmp = t_0; else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[z, -3e-139], N[(x - z), $MachinePrecision], If[LessEqual[z, -2.5e-244], t$95$0, If[LessEqual[z, -3.4e-296], x, If[LessEqual[z, 6.7e-137], t$95$0, N[(x - z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log y \cdot -0.5\\
\mathbf{if}\;z \leq -3 \cdot 10^{-139}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-244}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-296}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.7 \cdot 10^{-137}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -2.9999999999999999e-139 or 6.6999999999999998e-137 < z Initial program 99.8%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 70.7%
if -2.9999999999999999e-139 < z < -2.49999999999999999e-244 or -3.39999999999999997e-296 < z < 6.6999999999999998e-137Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
+-commutative99.8%
rem-cube-cbrt98.4%
Applied egg-rr98.4%
Taylor expanded in y around 0 66.9%
sub-neg66.9%
*-commutative66.9%
pow-base-166.9%
*-lft-identity66.9%
distribute-rgt-neg-in66.9%
metadata-eval66.9%
Simplified66.9%
Taylor expanded in x around 0 48.1%
*-commutative48.1%
Simplified48.1%
if -2.49999999999999999e-244 < z < -3.39999999999999997e-296Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in x around inf 58.4%
Final simplification64.9%
(FPCore (x y z)
:precision binary64
(if (<= z -3.8e+19)
(- x z)
(if (<= z -2.7e-84)
(- y (* y (log y)))
(if (<= z 104.0) (+ x (* (log y) -0.5)) (- x z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.8e+19) {
tmp = x - z;
} else if (z <= -2.7e-84) {
tmp = y - (y * log(y));
} else if (z <= 104.0) {
tmp = x + (log(y) * -0.5);
} else {
tmp = 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 <= (-3.8d+19)) then
tmp = x - z
else if (z <= (-2.7d-84)) then
tmp = y - (y * log(y))
else if (z <= 104.0d0) then
tmp = x + (log(y) * (-0.5d0))
else
tmp = x - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.8e+19) {
tmp = x - z;
} else if (z <= -2.7e-84) {
tmp = y - (y * Math.log(y));
} else if (z <= 104.0) {
tmp = x + (Math.log(y) * -0.5);
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.8e+19: tmp = x - z elif z <= -2.7e-84: tmp = y - (y * math.log(y)) elif z <= 104.0: tmp = x + (math.log(y) * -0.5) else: tmp = x - z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.8e+19) tmp = Float64(x - z); elseif (z <= -2.7e-84) tmp = Float64(y - Float64(y * log(y))); elseif (z <= 104.0) tmp = Float64(x + Float64(log(y) * -0.5)); else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.8e+19) tmp = x - z; elseif (z <= -2.7e-84) tmp = y - (y * log(y)); elseif (z <= 104.0) tmp = x + (log(y) * -0.5); else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.8e+19], N[(x - z), $MachinePrecision], If[LessEqual[z, -2.7e-84], N[(y - N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 104.0], N[(x + N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], N[(x - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+19}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-84}:\\
\;\;\;\;y - y \cdot \log y\\
\mathbf{elif}\;z \leq 104:\\
\;\;\;\;x + \log y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -3.8e19 or 104 < z Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 83.0%
if -3.8e19 < z < -2.6999999999999999e-84Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 96.2%
Taylor expanded in y around inf 72.5%
mul-1-neg72.5%
log-rec72.5%
distribute-rgt-neg-out72.5%
remove-double-neg72.5%
Simplified72.5%
Taylor expanded in x around 0 65.6%
if -2.6999999999999999e-84 < z < 104Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 99.5%
+-commutative99.5%
rem-cube-cbrt98.4%
Applied egg-rr98.4%
Taylor expanded in y around 0 67.4%
sub-neg67.4%
*-commutative67.4%
pow-base-167.4%
*-lft-identity67.4%
distribute-rgt-neg-in67.4%
metadata-eval67.4%
Simplified67.4%
Final simplification75.6%
(FPCore (x y z)
:precision binary64
(if (<= z -7e+107)
(- x z)
(if (<= z -1.65e-223)
(+ x (* y (- 1.0 (log y))))
(if (<= z 180.0) (+ x (* (log y) -0.5)) (- x z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -7e+107) {
tmp = x - z;
} else if (z <= -1.65e-223) {
tmp = x + (y * (1.0 - log(y)));
} else if (z <= 180.0) {
tmp = x + (log(y) * -0.5);
} else {
tmp = 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 <= (-7d+107)) then
tmp = x - z
else if (z <= (-1.65d-223)) then
tmp = x + (y * (1.0d0 - log(y)))
else if (z <= 180.0d0) then
tmp = x + (log(y) * (-0.5d0))
else
tmp = x - z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -7e+107) {
tmp = x - z;
} else if (z <= -1.65e-223) {
tmp = x + (y * (1.0 - Math.log(y)));
} else if (z <= 180.0) {
tmp = x + (Math.log(y) * -0.5);
} else {
tmp = x - z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -7e+107: tmp = x - z elif z <= -1.65e-223: tmp = x + (y * (1.0 - math.log(y))) elif z <= 180.0: tmp = x + (math.log(y) * -0.5) else: tmp = x - z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -7e+107) tmp = Float64(x - z); elseif (z <= -1.65e-223) tmp = Float64(x + Float64(y * Float64(1.0 - log(y)))); elseif (z <= 180.0) tmp = Float64(x + Float64(log(y) * -0.5)); else tmp = Float64(x - z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -7e+107) tmp = x - z; elseif (z <= -1.65e-223) tmp = x + (y * (1.0 - log(y))); elseif (z <= 180.0) tmp = x + (log(y) * -0.5); else tmp = x - z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -7e+107], N[(x - z), $MachinePrecision], If[LessEqual[z, -1.65e-223], N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 180.0], N[(x + N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], N[(x - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+107}:\\
\;\;\;\;x - z\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-223}:\\
\;\;\;\;x + y \cdot \left(1 - \log y\right)\\
\mathbf{elif}\;z \leq 180:\\
\;\;\;\;x + \log y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;x - z\\
\end{array}
\end{array}
if z < -6.9999999999999995e107 or 180 < z Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 85.9%
if -6.9999999999999995e107 < z < -1.64999999999999997e-223Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 96.9%
Taylor expanded in y around inf 79.5%
mul-1-neg79.5%
log-rec79.5%
distribute-rgt-neg-out79.5%
remove-double-neg79.5%
Simplified79.5%
sub-neg79.5%
associate-+l+79.5%
sub-neg79.5%
*-un-lft-identity79.5%
*-commutative79.5%
distribute-rgt-out--79.7%
+-commutative79.7%
Applied egg-rr79.7%
if -1.64999999999999997e-223 < z < 180Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 99.5%
+-commutative99.5%
rem-cube-cbrt98.3%
Applied egg-rr98.3%
Taylor expanded in y around 0 69.6%
sub-neg69.6%
*-commutative69.6%
pow-base-169.6%
*-lft-identity69.6%
distribute-rgt-neg-in69.6%
metadata-eval69.6%
Simplified69.6%
Final simplification79.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -3e+34) (not (<= z 104.0))) (- x z) (+ x (* (log y) -0.5))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3e+34) || !(z <= 104.0)) {
tmp = x - z;
} else {
tmp = x + (log(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 <= (-3d+34)) .or. (.not. (z <= 104.0d0))) then
tmp = x - z
else
tmp = x + (log(y) * (-0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3e+34) || !(z <= 104.0)) {
tmp = x - z;
} else {
tmp = x + (Math.log(y) * -0.5);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3e+34) or not (z <= 104.0): tmp = x - z else: tmp = x + (math.log(y) * -0.5) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3e+34) || !(z <= 104.0)) tmp = Float64(x - z); else tmp = Float64(x + Float64(log(y) * -0.5)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3e+34) || ~((z <= 104.0))) tmp = x - z; else tmp = x + (log(y) * -0.5); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3e+34], N[Not[LessEqual[z, 104.0]], $MachinePrecision]], N[(x - z), $MachinePrecision], N[(x + N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+34} \lor \neg \left(z \leq 104\right):\\
\;\;\;\;x - z\\
\mathbf{else}:\\
\;\;\;\;x + \log y \cdot -0.5\\
\end{array}
\end{array}
if z < -3.00000000000000018e34 or 104 < z Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 82.7%
if -3.00000000000000018e34 < z < 104Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in z around 0 99.2%
+-commutative99.2%
rem-cube-cbrt98.0%
Applied egg-rr98.0%
Taylor expanded in y around 0 64.5%
sub-neg64.5%
*-commutative64.5%
pow-base-164.5%
*-lft-identity64.5%
distribute-rgt-neg-in64.5%
metadata-eval64.5%
Simplified64.5%
Final simplification73.9%
(FPCore (x y z) :precision binary64 (if (<= y 0.28) (- (- x (* (log y) 0.5)) z) (+ x (- (* y (- 1.0 (log y))) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 0.28) {
tmp = (x - (log(y) * 0.5)) - z;
} else {
tmp = x + ((y * (1.0 - log(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 (y <= 0.28d0) then
tmp = (x - (log(y) * 0.5d0)) - z
else
tmp = x + ((y * (1.0d0 - log(y))) - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 0.28) {
tmp = (x - (Math.log(y) * 0.5)) - z;
} else {
tmp = x + ((y * (1.0 - Math.log(y))) - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 0.28: tmp = (x - (math.log(y) * 0.5)) - z else: tmp = x + ((y * (1.0 - math.log(y))) - z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 0.28) tmp = Float64(Float64(x - Float64(log(y) * 0.5)) - z); else tmp = Float64(x + Float64(Float64(y * Float64(1.0 - log(y))) - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 0.28) tmp = (x - (log(y) * 0.5)) - z; else tmp = x + ((y * (1.0 - log(y))) - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 0.28], N[(N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(x + N[(N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.28:\\
\;\;\;\;\left(x - \log y \cdot 0.5\right) - z\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \left(1 - \log y\right) - z\right)\\
\end{array}
\end{array}
if y < 0.28000000000000003Initial program 100.0%
Taylor expanded in y around 0 99.4%
if 0.28000000000000003 < y Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
associate-+l+99.7%
associate-+r-99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-def99.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 99.4%
log-rec99.4%
sub-neg99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y z) :precision binary64 (+ (- x (* (log y) (+ y 0.5))) (- y z)))
double code(double x, double y, double z) {
return (x - (log(y) * (y + 0.5))) + (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 - (log(y) * (y + 0.5d0))) + (y - z)
end function
public static double code(double x, double y, double z) {
return (x - (Math.log(y) * (y + 0.5))) + (y - z);
}
def code(x, y, z): return (x - (math.log(y) * (y + 0.5))) + (y - z)
function code(x, y, z) return Float64(Float64(x - Float64(log(y) * Float64(y + 0.5))) + Float64(y - z)) end
function tmp = code(x, y, z) tmp = (x - (log(y) * (y + 0.5))) + (y - z); end
code[x_, y_, z_] := N[(N[(x - N[(N[Log[y], $MachinePrecision] * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \log y \cdot \left(y + 0.5\right)\right) + \left(y - z\right)
\end{array}
Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.4e+107) (not (<= z 3.7e+33))) (- z) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.4e+107) || !(z <= 3.7e+33)) {
tmp = -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 <= (-2.4d+107)) .or. (.not. (z <= 3.7d+33))) then
tmp = -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.4e+107) || !(z <= 3.7e+33)) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.4e+107) or not (z <= 3.7e+33): tmp = -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.4e+107) || !(z <= 3.7e+33)) tmp = Float64(-z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.4e+107) || ~((z <= 3.7e+33))) tmp = -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.4e+107], N[Not[LessEqual[z, 3.7e+33]], $MachinePrecision]], (-z), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+107} \lor \neg \left(z \leq 3.7 \cdot 10^{+33}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.4000000000000001e107 or 3.6999999999999999e33 < z Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around inf 73.2%
neg-mul-173.2%
Simplified73.2%
if -2.4000000000000001e107 < z < 3.6999999999999999e33Initial program 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in x around inf 36.0%
Final simplification52.5%
(FPCore (x y z) :precision binary64 (- x z))
double code(double x, double y, double z) {
return 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 - z
end function
public static double code(double x, double y, double z) {
return x - z;
}
def code(x, y, z): return x - z
function code(x, y, z) return Float64(x - z) end
function tmp = code(x, y, z) tmp = x - z; end
code[x_, y_, z_] := N[(x - z), $MachinePrecision]
\begin{array}{l}
\\
x - z
\end{array}
Initial program 99.8%
Taylor expanded in y around 0 99.9%
Taylor expanded in x around inf 58.6%
Final simplification58.6%
(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 99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in x around inf 26.4%
Final simplification26.4%
(FPCore (x y z) :precision binary64 (- (- (+ y x) z) (* (+ y 0.5) (log y))))
double code(double x, double y, double z) {
return ((y + x) - z) - ((y + 0.5) * log(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((y + x) - z) - ((y + 0.5d0) * log(y))
end function
public static double code(double x, double y, double z) {
return ((y + x) - z) - ((y + 0.5) * Math.log(y));
}
def code(x, y, z): return ((y + x) - z) - ((y + 0.5) * math.log(y))
function code(x, y, z) return Float64(Float64(Float64(y + x) - z) - Float64(Float64(y + 0.5) * log(y))) end
function tmp = code(x, y, z) tmp = ((y + x) - z) - ((y + 0.5) * log(y)); end
code[x_, y_, z_] := N[(N[(N[(y + x), $MachinePrecision] - z), $MachinePrecision] - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(y + x\right) - z\right) - \left(y + 0.5\right) \cdot \log y
\end{array}
herbie shell --seed 2024096
(FPCore (x y z)
:name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(- (- (+ y x) z) (* (+ y 0.5) (log y)))
(- (+ (- x (* (+ y 0.5) (log y))) y) z))