
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (- (fma x (log y) (- (log t) z)) y))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (log(t) - z)) - y;
}
function code(x, y, z, t) return Float64(fma(x, log(y), Float64(log(t) - z)) - y) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
\end{array}
Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)) (t_2 (- (- y) z)))
(if (<= t_1 -5e+222)
t_1
(if (<= t_1 -2e+68)
t_2
(if (<= t_1 -5.4e+42)
t_1
(if (<= t_1 -1000.0) t_2 (if (<= t_1 1e+34) (- (log t) z) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double t_2 = -y - z;
double tmp;
if (t_1 <= -5e+222) {
tmp = t_1;
} else if (t_1 <= -2e+68) {
tmp = t_2;
} else if (t_1 <= -5.4e+42) {
tmp = t_1;
} else if (t_1 <= -1000.0) {
tmp = t_2;
} else if (t_1 <= 1e+34) {
tmp = log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * log(y)) - y
t_2 = -y - z
if (t_1 <= (-5d+222)) then
tmp = t_1
else if (t_1 <= (-2d+68)) then
tmp = t_2
else if (t_1 <= (-5.4d+42)) then
tmp = t_1
else if (t_1 <= (-1000.0d0)) then
tmp = t_2
else if (t_1 <= 1d+34) then
tmp = log(t) - z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * Math.log(y)) - y;
double t_2 = -y - z;
double tmp;
if (t_1 <= -5e+222) {
tmp = t_1;
} else if (t_1 <= -2e+68) {
tmp = t_2;
} else if (t_1 <= -5.4e+42) {
tmp = t_1;
} else if (t_1 <= -1000.0) {
tmp = t_2;
} else if (t_1 <= 1e+34) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y t_2 = -y - z tmp = 0 if t_1 <= -5e+222: tmp = t_1 elif t_1 <= -2e+68: tmp = t_2 elif t_1 <= -5.4e+42: tmp = t_1 elif t_1 <= -1000.0: tmp = t_2 elif t_1 <= 1e+34: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) t_2 = Float64(Float64(-y) - z) tmp = 0.0 if (t_1 <= -5e+222) tmp = t_1; elseif (t_1 <= -2e+68) tmp = t_2; elseif (t_1 <= -5.4e+42) tmp = t_1; elseif (t_1 <= -1000.0) tmp = t_2; elseif (t_1 <= 1e+34) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; t_2 = -y - z; tmp = 0.0; if (t_1 <= -5e+222) tmp = t_1; elseif (t_1 <= -2e+68) tmp = t_2; elseif (t_1 <= -5.4e+42) tmp = t_1; elseif (t_1 <= -1000.0) tmp = t_2; elseif (t_1 <= 1e+34) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+222], t$95$1, If[LessEqual[t$95$1, -2e+68], t$95$2, If[LessEqual[t$95$1, -5.4e+42], t$95$1, If[LessEqual[t$95$1, -1000.0], t$95$2, If[LessEqual[t$95$1, 1e+34], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+222}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{+68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -5.4 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq -1000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 10^{+34}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.00000000000000023e222 or -1.99999999999999991e68 < (-.f64 (*.f64 x (log.f64 y)) y) < -5.4000000000000001e42 or 9.99999999999999946e33 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
add-cube-cbrt98.8%
pow398.8%
Applied egg-rr98.8%
Taylor expanded in z around 0 88.9%
pow-base-188.9%
*-lft-identity88.9%
Simplified88.9%
if -5.00000000000000023e222 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999991e68 or -5.4000000000000001e42 < (-.f64 (*.f64 x (log.f64 y)) y) < -1e3Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 96.2%
add-cube-cbrt96.0%
pow396.0%
Applied egg-rr96.0%
Taylor expanded in x around 0 79.6%
neg-mul-179.6%
neg-sub079.6%
associate--r+79.6%
neg-sub079.6%
Simplified79.6%
if -1e3 < (-.f64 (*.f64 x (log.f64 y)) y) < 9.99999999999999946e33Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
add-log-exp55.9%
associate--r-55.9%
exp-sum55.9%
associate--l-55.9%
add-exp-log55.9%
Applied egg-rr55.9%
Taylor expanded in x around 0 54.8%
distribute-neg-in54.8%
unsub-neg54.8%
Simplified54.8%
Taylor expanded in y around 0 53.0%
log-prod53.0%
rem-log-exp94.7%
sub-neg94.7%
Simplified94.7%
Final simplification86.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)) (t_3 (- (- y) z)))
(if (<= t_2 -5e+222)
t_2
(if (<= t_2 -2e+68)
t_3
(if (<= t_2 -5.4e+42)
t_2
(if (<= t_2 -1000.0)
t_3
(if (<= t_2 0.02) (- (log t) z) (- t_1 z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double t_3 = -y - z;
double tmp;
if (t_2 <= -5e+222) {
tmp = t_2;
} else if (t_2 <= -2e+68) {
tmp = t_3;
} else if (t_2 <= -5.4e+42) {
tmp = t_2;
} else if (t_2 <= -1000.0) {
tmp = t_3;
} else if (t_2 <= 0.02) {
tmp = log(t) - z;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
t_3 = -y - z
if (t_2 <= (-5d+222)) then
tmp = t_2
else if (t_2 <= (-2d+68)) then
tmp = t_3
else if (t_2 <= (-5.4d+42)) then
tmp = t_2
else if (t_2 <= (-1000.0d0)) then
tmp = t_3
else if (t_2 <= 0.02d0) then
tmp = log(t) - z
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double t_3 = -y - z;
double tmp;
if (t_2 <= -5e+222) {
tmp = t_2;
} else if (t_2 <= -2e+68) {
tmp = t_3;
} else if (t_2 <= -5.4e+42) {
tmp = t_2;
} else if (t_2 <= -1000.0) {
tmp = t_3;
} else if (t_2 <= 0.02) {
tmp = Math.log(t) - z;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y t_3 = -y - z tmp = 0 if t_2 <= -5e+222: tmp = t_2 elif t_2 <= -2e+68: tmp = t_3 elif t_2 <= -5.4e+42: tmp = t_2 elif t_2 <= -1000.0: tmp = t_3 elif t_2 <= 0.02: tmp = math.log(t) - z else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) t_3 = Float64(Float64(-y) - z) tmp = 0.0 if (t_2 <= -5e+222) tmp = t_2; elseif (t_2 <= -2e+68) tmp = t_3; elseif (t_2 <= -5.4e+42) tmp = t_2; elseif (t_2 <= -1000.0) tmp = t_3; elseif (t_2 <= 0.02) tmp = Float64(log(t) - z); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; t_3 = -y - z; tmp = 0.0; if (t_2 <= -5e+222) tmp = t_2; elseif (t_2 <= -2e+68) tmp = t_3; elseif (t_2 <= -5.4e+42) tmp = t_2; elseif (t_2 <= -1000.0) tmp = t_3; elseif (t_2 <= 0.02) tmp = log(t) - z; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, Block[{t$95$3 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+222], t$95$2, If[LessEqual[t$95$2, -2e+68], t$95$3, If[LessEqual[t$95$2, -5.4e+42], t$95$2, If[LessEqual[t$95$2, -1000.0], t$95$3, If[LessEqual[t$95$2, 0.02], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t_1 - y\\
t_3 := \left(-y\right) - z\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{+68}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq -5.4 \cdot 10^{+42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq -1000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 0.02:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.00000000000000023e222 or -1.99999999999999991e68 < (-.f64 (*.f64 x (log.f64 y)) y) < -5.4000000000000001e42Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
add-cube-cbrt99.0%
pow399.1%
Applied egg-rr99.1%
Taylor expanded in z around 0 95.0%
pow-base-195.0%
*-lft-identity95.0%
Simplified95.0%
if -5.00000000000000023e222 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999991e68 or -5.4000000000000001e42 < (-.f64 (*.f64 x (log.f64 y)) y) < -1e3Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 96.2%
add-cube-cbrt96.0%
pow396.0%
Applied egg-rr96.0%
Taylor expanded in x around 0 79.6%
neg-mul-179.6%
neg-sub079.6%
associate--r+79.6%
neg-sub079.6%
Simplified79.6%
if -1e3 < (-.f64 (*.f64 x (log.f64 y)) y) < 0.0200000000000000004Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
add-log-exp58.6%
associate--r-58.6%
exp-sum58.6%
associate--l-58.6%
add-exp-log58.6%
Applied egg-rr58.6%
Taylor expanded in x around 0 57.5%
distribute-neg-in57.5%
unsub-neg57.5%
Simplified57.5%
Taylor expanded in y around 0 55.5%
log-prod55.5%
rem-log-exp95.2%
sub-neg95.2%
Simplified95.2%
if 0.0200000000000000004 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
associate-+l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
add-cube-cbrt98.6%
pow398.5%
Applied egg-rr98.5%
Taylor expanded in y around 0 97.8%
pow-base-197.8%
*-lft-identity97.8%
Simplified97.8%
Final simplification89.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -5e+222)
t_2
(if (<= t_2 -2e+68)
(- (- y) z)
(if (<= t_2 -5.4e+42)
t_2
(if (<= t_2 0.02) (- (- (log t) z) y) (- t_1 z)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -5e+222) {
tmp = t_2;
} else if (t_2 <= -2e+68) {
tmp = -y - z;
} else if (t_2 <= -5.4e+42) {
tmp = t_2;
} else if (t_2 <= 0.02) {
tmp = (log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-5d+222)) then
tmp = t_2
else if (t_2 <= (-2d+68)) then
tmp = -y - z
else if (t_2 <= (-5.4d+42)) then
tmp = t_2
else if (t_2 <= 0.02d0) then
tmp = (log(t) - z) - y
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -5e+222) {
tmp = t_2;
} else if (t_2 <= -2e+68) {
tmp = -y - z;
} else if (t_2 <= -5.4e+42) {
tmp = t_2;
} else if (t_2 <= 0.02) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -5e+222: tmp = t_2 elif t_2 <= -2e+68: tmp = -y - z elif t_2 <= -5.4e+42: tmp = t_2 elif t_2 <= 0.02: tmp = (math.log(t) - z) - y else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -5e+222) tmp = t_2; elseif (t_2 <= -2e+68) tmp = Float64(Float64(-y) - z); elseif (t_2 <= -5.4e+42) tmp = t_2; elseif (t_2 <= 0.02) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -5e+222) tmp = t_2; elseif (t_2 <= -2e+68) tmp = -y - z; elseif (t_2 <= -5.4e+42) tmp = t_2; elseif (t_2 <= 0.02) tmp = (log(t) - z) - y; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+222], t$95$2, If[LessEqual[t$95$2, -2e+68], N[((-y) - z), $MachinePrecision], If[LessEqual[t$95$2, -5.4e+42], t$95$2, If[LessEqual[t$95$2, 0.02], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t_1 - y\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{+68}:\\
\;\;\;\;\left(-y\right) - z\\
\mathbf{elif}\;t_2 \leq -5.4 \cdot 10^{+42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 0.02:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.00000000000000023e222 or -1.99999999999999991e68 < (-.f64 (*.f64 x (log.f64 y)) y) < -5.4000000000000001e42Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
add-cube-cbrt99.0%
pow399.1%
Applied egg-rr99.1%
Taylor expanded in z around 0 95.0%
pow-base-195.0%
*-lft-identity95.0%
Simplified95.0%
if -5.00000000000000023e222 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999991e68Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
add-cube-cbrt99.6%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 81.9%
neg-mul-181.9%
neg-sub081.9%
associate--r+81.9%
neg-sub081.9%
Simplified81.9%
if -5.4000000000000001e42 < (-.f64 (*.f64 x (log.f64 y)) y) < 0.0200000000000000004Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 93.2%
if 0.0200000000000000004 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
associate-+l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
add-cube-cbrt98.6%
pow398.5%
Applied egg-rr98.5%
Taylor expanded in y around 0 97.8%
pow-base-197.8%
*-lft-identity97.8%
Simplified97.8%
Final simplification91.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (or (<= t_1 -30000.0) (not (<= t_1 0.02)))
(- t_1 z)
(- (- (log t) z) y))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if ((t_1 <= -30000.0) || !(t_1 <= 0.02)) {
tmp = t_1 - z;
} else {
tmp = (log(t) - z) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - y
if ((t_1 <= (-30000.0d0)) .or. (.not. (t_1 <= 0.02d0))) then
tmp = t_1 - z
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * Math.log(y)) - y;
double tmp;
if ((t_1 <= -30000.0) || !(t_1 <= 0.02)) {
tmp = t_1 - z;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if (t_1 <= -30000.0) or not (t_1 <= 0.02): tmp = t_1 - z else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if ((t_1 <= -30000.0) || !(t_1 <= 0.02)) tmp = Float64(t_1 - z); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; tmp = 0.0; if ((t_1 <= -30000.0) || ~((t_1 <= 0.02))) tmp = t_1 - z; else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -30000.0], N[Not[LessEqual[t$95$1, 0.02]], $MachinePrecision]], N[(t$95$1 - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t_1 \leq -30000 \lor \neg \left(t_1 \leq 0.02\right):\\
\;\;\;\;t_1 - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -3e4 or 0.0200000000000000004 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 98.7%
if -3e4 < (-.f64 (*.f64 x (log.f64 y)) y) < 0.0200000000000000004Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 98.9%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (<= t_1 -30000.0)
(fma (log y) x (- (- y) z))
(if (<= t_1 0.02) (- (- (log t) z) y) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if (t_1 <= -30000.0) {
tmp = fma(log(y), x, (-y - z));
} else if (t_1 <= 0.02) {
tmp = (log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if (t_1 <= -30000.0) tmp = fma(log(y), x, Float64(Float64(-y) - z)); elseif (t_1 <= 0.02) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(t_1 - z); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$1, -30000.0], N[(N[Log[y], $MachinePrecision] * x + N[((-y) - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.02], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t_1 \leq -30000:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \left(-y\right) - z\right)\\
\mathbf{elif}\;t_1 \leq 0.02:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -3e4Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 98.5%
add-cube-cbrt98.0%
pow398.1%
Applied egg-rr98.1%
rem-cube-cbrt98.5%
associate--l-98.5%
*-commutative98.5%
fma-neg98.5%
Applied egg-rr98.5%
if -3e4 < (-.f64 (*.f64 x (log.f64 y)) y) < 0.0200000000000000004Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 98.9%
if 0.0200000000000000004 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
associate-+l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 460.0) (- (+ (log t) t_1) z) (- (- t_1 y) z))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 460.0) {
tmp = (log(t) + t_1) - z;
} else {
tmp = (t_1 - y) - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (y <= 460.0d0) then
tmp = (log(t) + t_1) - z
else
tmp = (t_1 - y) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if (y <= 460.0) {
tmp = (Math.log(t) + t_1) - z;
} else {
tmp = (t_1 - y) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 460.0: tmp = (math.log(t) + t_1) - z else: tmp = (t_1 - y) - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 460.0) tmp = Float64(Float64(log(t) + t_1) - z); else tmp = Float64(Float64(t_1 - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 460.0) tmp = (log(t) + t_1) - z; else tmp = (t_1 - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 460.0], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - z), $MachinePrecision], N[(N[(t$95$1 - y), $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 460:\\
\;\;\;\;\left(\log t + t_1\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - y\right) - z\\
\end{array}
\end{array}
if y < 460Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around 0 98.2%
if 460 < y Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in z around inf 98.8%
Final simplification98.5%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((x * log(y)) - y) - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = log(t) + (((x * log(y)) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((x * Math.log(y)) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((x * math.log(y)) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(x * log(y)) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((x * log(y)) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(x \cdot \log y - y\right) - z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) y)) (t_2 (* x (log y))) (t_3 (- (- y) z)))
(if (<= x -6.3e+187)
t_2
(if (<= x 9.2e-229)
t_3
(if (<= x 2.05e-173)
t_1
(if (<= x 8e-118)
t_3
(if (<= x 8e-22) t_1 (if (<= x 3.05e+196) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double t_2 = x * log(y);
double t_3 = -y - z;
double tmp;
if (x <= -6.3e+187) {
tmp = t_2;
} else if (x <= 9.2e-229) {
tmp = t_3;
} else if (x <= 2.05e-173) {
tmp = t_1;
} else if (x <= 8e-118) {
tmp = t_3;
} else if (x <= 8e-22) {
tmp = t_1;
} else if (x <= 3.05e+196) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = log(t) - y
t_2 = x * log(y)
t_3 = -y - z
if (x <= (-6.3d+187)) then
tmp = t_2
else if (x <= 9.2d-229) then
tmp = t_3
else if (x <= 2.05d-173) then
tmp = t_1
else if (x <= 8d-118) then
tmp = t_3
else if (x <= 8d-22) then
tmp = t_1
else if (x <= 3.05d+196) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - y;
double t_2 = x * Math.log(y);
double t_3 = -y - z;
double tmp;
if (x <= -6.3e+187) {
tmp = t_2;
} else if (x <= 9.2e-229) {
tmp = t_3;
} else if (x <= 2.05e-173) {
tmp = t_1;
} else if (x <= 8e-118) {
tmp = t_3;
} else if (x <= 8e-22) {
tmp = t_1;
} else if (x <= 3.05e+196) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - y t_2 = x * math.log(y) t_3 = -y - z tmp = 0 if x <= -6.3e+187: tmp = t_2 elif x <= 9.2e-229: tmp = t_3 elif x <= 2.05e-173: tmp = t_1 elif x <= 8e-118: tmp = t_3 elif x <= 8e-22: tmp = t_1 elif x <= 3.05e+196: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - y) t_2 = Float64(x * log(y)) t_3 = Float64(Float64(-y) - z) tmp = 0.0 if (x <= -6.3e+187) tmp = t_2; elseif (x <= 9.2e-229) tmp = t_3; elseif (x <= 2.05e-173) tmp = t_1; elseif (x <= 8e-118) tmp = t_3; elseif (x <= 8e-22) tmp = t_1; elseif (x <= 3.05e+196) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - y; t_2 = x * log(y); t_3 = -y - z; tmp = 0.0; if (x <= -6.3e+187) tmp = t_2; elseif (x <= 9.2e-229) tmp = t_3; elseif (x <= 2.05e-173) tmp = t_1; elseif (x <= 8e-118) tmp = t_3; elseif (x <= 8e-22) tmp = t_1; elseif (x <= 3.05e+196) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -6.3e+187], t$95$2, If[LessEqual[x, 9.2e-229], t$95$3, If[LessEqual[x, 2.05e-173], t$95$1, If[LessEqual[x, 8e-118], t$95$3, If[LessEqual[x, 8e-22], t$95$1, If[LessEqual[x, 3.05e+196], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
t_2 := x \cdot \log y\\
t_3 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -6.3 \cdot 10^{+187}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-229}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-173}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-118}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.05 \cdot 10^{+196}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -6.30000000000000005e187 or 3.05000000000000018e196 < x Initial program 99.5%
associate-+l-99.5%
Simplified99.5%
Taylor expanded in x around inf 95.1%
if -6.30000000000000005e187 < x < 9.19999999999999983e-229 or 2.0499999999999999e-173 < x < 7.99999999999999988e-118 or 8.0000000000000004e-22 < x < 3.05000000000000018e196Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 89.6%
add-cube-cbrt89.2%
pow389.3%
Applied egg-rr89.3%
Taylor expanded in x around 0 71.0%
neg-mul-171.0%
neg-sub071.0%
associate--r+71.0%
neg-sub071.0%
Simplified71.0%
if 9.19999999999999983e-229 < x < 2.0499999999999999e-173 or 7.99999999999999988e-118 < x < 8.0000000000000004e-22Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
add-log-exp51.0%
associate--r-51.0%
exp-sum51.0%
associate--l-51.0%
add-exp-log51.0%
Applied egg-rr51.0%
Taylor expanded in x around 0 51.0%
distribute-neg-in51.0%
unsub-neg51.0%
Simplified51.0%
Taylor expanded in z around 0 47.7%
exp-neg47.7%
associate-*r/47.7%
log-div50.5%
*-rgt-identity50.5%
rem-log-exp82.5%
Simplified82.5%
Final simplification76.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (- y) z)))
(if (<= x -2.8e+189)
t_1
(if (<= x 4e-284)
t_2
(if (<= x 2.5e-187)
(- (log t) z)
(if (<= x 2.4e-118)
t_2
(if (<= x 6.8e-22)
(- (log t) y)
(if (<= x 3.05e+196) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = -y - z;
double tmp;
if (x <= -2.8e+189) {
tmp = t_1;
} else if (x <= 4e-284) {
tmp = t_2;
} else if (x <= 2.5e-187) {
tmp = log(t) - z;
} else if (x <= 2.4e-118) {
tmp = t_2;
} else if (x <= 6.8e-22) {
tmp = log(t) - y;
} else if (x <= 3.05e+196) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = -y - z
if (x <= (-2.8d+189)) then
tmp = t_1
else if (x <= 4d-284) then
tmp = t_2
else if (x <= 2.5d-187) then
tmp = log(t) - z
else if (x <= 2.4d-118) then
tmp = t_2
else if (x <= 6.8d-22) then
tmp = log(t) - y
else if (x <= 3.05d+196) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = -y - z;
double tmp;
if (x <= -2.8e+189) {
tmp = t_1;
} else if (x <= 4e-284) {
tmp = t_2;
} else if (x <= 2.5e-187) {
tmp = Math.log(t) - z;
} else if (x <= 2.4e-118) {
tmp = t_2;
} else if (x <= 6.8e-22) {
tmp = Math.log(t) - y;
} else if (x <= 3.05e+196) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = -y - z tmp = 0 if x <= -2.8e+189: tmp = t_1 elif x <= 4e-284: tmp = t_2 elif x <= 2.5e-187: tmp = math.log(t) - z elif x <= 2.4e-118: tmp = t_2 elif x <= 6.8e-22: tmp = math.log(t) - y elif x <= 3.05e+196: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(-y) - z) tmp = 0.0 if (x <= -2.8e+189) tmp = t_1; elseif (x <= 4e-284) tmp = t_2; elseif (x <= 2.5e-187) tmp = Float64(log(t) - z); elseif (x <= 2.4e-118) tmp = t_2; elseif (x <= 6.8e-22) tmp = Float64(log(t) - y); elseif (x <= 3.05e+196) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = -y - z; tmp = 0.0; if (x <= -2.8e+189) tmp = t_1; elseif (x <= 4e-284) tmp = t_2; elseif (x <= 2.5e-187) tmp = log(t) - z; elseif (x <= 2.4e-118) tmp = t_2; elseif (x <= 6.8e-22) tmp = log(t) - y; elseif (x <= 3.05e+196) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -2.8e+189], t$95$1, If[LessEqual[x, 4e-284], t$95$2, If[LessEqual[x, 2.5e-187], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 2.4e-118], t$95$2, If[LessEqual[x, 6.8e-22], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 3.05e+196], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-284}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-187}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-118}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-22}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 3.05 \cdot 10^{+196}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.80000000000000006e189 or 3.05000000000000018e196 < x Initial program 99.5%
associate-+l-99.5%
Simplified99.5%
Taylor expanded in x around inf 95.1%
if -2.80000000000000006e189 < x < 4.00000000000000015e-284 or 2.4999999999999998e-187 < x < 2.4000000000000001e-118 or 6.7999999999999997e-22 < x < 3.05000000000000018e196Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 89.5%
add-cube-cbrt89.1%
pow389.2%
Applied egg-rr89.2%
Taylor expanded in x around 0 70.8%
neg-mul-170.8%
neg-sub070.8%
associate--r+70.8%
neg-sub070.8%
Simplified70.8%
if 4.00000000000000015e-284 < x < 2.4999999999999998e-187Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
add-log-exp55.8%
associate--r-55.8%
exp-sum55.8%
associate--l-55.8%
add-exp-log55.8%
Applied egg-rr55.8%
Taylor expanded in x around 0 55.8%
distribute-neg-in55.8%
unsub-neg55.8%
Simplified55.8%
Taylor expanded in y around 0 51.8%
log-prod51.8%
rem-log-exp81.9%
sub-neg81.9%
Simplified81.9%
if 2.4000000000000001e-118 < x < 6.7999999999999997e-22Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
add-log-exp46.4%
associate--r-46.4%
exp-sum46.4%
associate--l-46.4%
add-exp-log46.4%
Applied egg-rr46.4%
Taylor expanded in x around 0 46.4%
distribute-neg-in46.4%
unsub-neg46.4%
Simplified46.4%
Taylor expanded in z around 0 44.7%
exp-neg44.7%
associate-*r/44.7%
log-div48.9%
*-rgt-identity48.9%
rem-log-exp83.9%
Simplified83.9%
Final simplification76.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.8e+188) (not (<= x 1.75e+197))) (* x (log y)) (- (- y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.8e+188) || !(x <= 1.75e+197)) {
tmp = x * log(y);
} else {
tmp = -y - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-3.8d+188)) .or. (.not. (x <= 1.75d+197))) then
tmp = x * log(y)
else
tmp = -y - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.8e+188) || !(x <= 1.75e+197)) {
tmp = x * Math.log(y);
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.8e+188) or not (x <= 1.75e+197): tmp = x * math.log(y) else: tmp = -y - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.8e+188) || !(x <= 1.75e+197)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.8e+188) || ~((x <= 1.75e+197))) tmp = x * log(y); else tmp = -y - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.8e+188], N[Not[LessEqual[x, 1.75e+197]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-y) - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+188} \lor \neg \left(x \leq 1.75 \cdot 10^{+197}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if x < -3.7999999999999998e188 or 1.75e197 < x Initial program 99.5%
associate-+l-99.5%
Simplified99.5%
Taylor expanded in x around inf 95.1%
if -3.7999999999999998e188 < x < 1.75e197Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 83.2%
add-cube-cbrt82.9%
pow382.9%
Applied egg-rr82.9%
Taylor expanded in x around 0 67.6%
neg-mul-167.6%
neg-sub067.6%
associate--r+67.6%
neg-sub067.6%
Simplified67.6%
Final simplification72.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.25e+101) (not (<= z 3.9e+133))) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.25e+101) || !(z <= 3.9e+133)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.25d+101)) .or. (.not. (z <= 3.9d+133))) then
tmp = -z
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.25e+101) || !(z <= 3.9e+133)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.25e+101) or not (z <= 3.9e+133): tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.25e+101) || !(z <= 3.9e+133)) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.25e+101) || ~((z <= 3.9e+133))) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.25e+101], N[Not[LessEqual[z, 3.9e+133]], $MachinePrecision]], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+101} \lor \neg \left(z \leq 3.9 \cdot 10^{+133}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -1.24999999999999997e101 or 3.90000000000000014e133 < z Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 78.0%
neg-mul-178.0%
Simplified78.0%
if -1.24999999999999997e101 < z < 3.90000000000000014e133Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around inf 37.3%
neg-mul-137.3%
Simplified37.3%
Final simplification50.0%
(FPCore (x y z t) :precision binary64 (- (- y) z))
double code(double x, double y, double z, double t) {
return -y - z;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -y - z
end function
public static double code(double x, double y, double z, double t) {
return -y - z;
}
def code(x, y, z, t): return -y - z
function code(x, y, z, t) return Float64(Float64(-y) - z) end
function tmp = code(x, y, z, t) tmp = -y - z; end
code[x_, y_, z_, t_] := N[((-y) - z), $MachinePrecision]
\begin{array}{l}
\\
\left(-y\right) - z
\end{array}
Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 86.0%
add-cube-cbrt85.5%
pow385.6%
Applied egg-rr85.6%
Taylor expanded in x around 0 57.1%
neg-mul-157.1%
neg-sub057.1%
associate--r+57.1%
neg-sub057.1%
Simplified57.1%
Final simplification57.1%
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
return -y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -y
end function
public static double code(double x, double y, double z, double t) {
return -y;
}
def code(x, y, z, t): return -y
function code(x, y, z, t) return Float64(-y) end
function tmp = code(x, y, z, t) tmp = -y; end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in y around inf 28.9%
neg-mul-128.9%
Simplified28.9%
Final simplification28.9%
herbie shell --seed 2024013
(FPCore (x y z t)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (- (* x (log y)) y) z) (log t)))