
(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 9 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 (+ (- (- (* 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}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (log t) y)))
(if (<= x -4.7e+67)
t_1
(if (<= x -1.7e-188)
t_2
(if (<= x -2.45e-256)
(- z)
(if (<= x 4e-255)
t_2
(if (<= x 2.1e-177) (- z) (if (<= x 9.4e+21) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = log(t) - y;
double tmp;
if (x <= -4.7e+67) {
tmp = t_1;
} else if (x <= -1.7e-188) {
tmp = t_2;
} else if (x <= -2.45e-256) {
tmp = -z;
} else if (x <= 4e-255) {
tmp = t_2;
} else if (x <= 2.1e-177) {
tmp = -z;
} else if (x <= 9.4e+21) {
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 = log(t) - y
if (x <= (-4.7d+67)) then
tmp = t_1
else if (x <= (-1.7d-188)) then
tmp = t_2
else if (x <= (-2.45d-256)) then
tmp = -z
else if (x <= 4d-255) then
tmp = t_2
else if (x <= 2.1d-177) then
tmp = -z
else if (x <= 9.4d+21) 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 = Math.log(t) - y;
double tmp;
if (x <= -4.7e+67) {
tmp = t_1;
} else if (x <= -1.7e-188) {
tmp = t_2;
} else if (x <= -2.45e-256) {
tmp = -z;
} else if (x <= 4e-255) {
tmp = t_2;
} else if (x <= 2.1e-177) {
tmp = -z;
} else if (x <= 9.4e+21) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = math.log(t) - y tmp = 0 if x <= -4.7e+67: tmp = t_1 elif x <= -1.7e-188: tmp = t_2 elif x <= -2.45e-256: tmp = -z elif x <= 4e-255: tmp = t_2 elif x <= 2.1e-177: tmp = -z elif x <= 9.4e+21: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(log(t) - y) tmp = 0.0 if (x <= -4.7e+67) tmp = t_1; elseif (x <= -1.7e-188) tmp = t_2; elseif (x <= -2.45e-256) tmp = Float64(-z); elseif (x <= 4e-255) tmp = t_2; elseif (x <= 2.1e-177) tmp = Float64(-z); elseif (x <= 9.4e+21) 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 = log(t) - y; tmp = 0.0; if (x <= -4.7e+67) tmp = t_1; elseif (x <= -1.7e-188) tmp = t_2; elseif (x <= -2.45e-256) tmp = -z; elseif (x <= 4e-255) tmp = t_2; elseif (x <= 2.1e-177) tmp = -z; elseif (x <= 9.4e+21) 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[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -4.7e+67], t$95$1, If[LessEqual[x, -1.7e-188], t$95$2, If[LessEqual[x, -2.45e-256], (-z), If[LessEqual[x, 4e-255], t$95$2, If[LessEqual[x, 2.1e-177], (-z), If[LessEqual[x, 9.4e+21], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - y\\
\mathbf{if}\;x \leq -4.7 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-188}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.45 \cdot 10^{-256}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-255}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-177}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 9.4 \cdot 10^{+21}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -4.70000000000000017e67 or 9.4e21 < x Initial program 99.5%
associate--l-99.5%
associate-+l-99.5%
*-commutative99.5%
add-cube-cbrt98.3%
associate-*l*98.4%
fma-neg98.3%
pow298.3%
Applied egg-rr98.3%
Taylor expanded in x around inf 71.6%
pow-base-171.6%
associate-*r*71.6%
*-lft-identity71.6%
Simplified71.6%
if -4.70000000000000017e67 < x < -1.70000000000000014e-188 or -2.44999999999999998e-256 < x < 4e-255 or 2.10000000000000001e-177 < x < 9.4e21Initial program 100.0%
Taylor expanded in z around 0 67.7%
Taylor expanded in x around 0 65.5%
if -1.70000000000000014e-188 < x < -2.44999999999999998e-256 or 4e-255 < x < 2.10000000000000001e-177Initial program 100.0%
associate--l-100.0%
associate-+l-100.0%
add-cube-cbrt100.0%
associate-*l*100.0%
fma-neg100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 71.6%
neg-mul-171.6%
Simplified71.6%
Final simplification69.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -3.7e+67)
t_1
(if (<= x 2.7e-176) (- z) (if (<= x 2.85e+22) (- y) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -3.7e+67) {
tmp = t_1;
} else if (x <= 2.7e-176) {
tmp = -z;
} else if (x <= 2.85e+22) {
tmp = -y;
} 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) :: tmp
t_1 = x * log(y)
if (x <= (-3.7d+67)) then
tmp = t_1
else if (x <= 2.7d-176) then
tmp = -z
else if (x <= 2.85d+22) then
tmp = -y
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 tmp;
if (x <= -3.7e+67) {
tmp = t_1;
} else if (x <= 2.7e-176) {
tmp = -z;
} else if (x <= 2.85e+22) {
tmp = -y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -3.7e+67: tmp = t_1 elif x <= 2.7e-176: tmp = -z elif x <= 2.85e+22: tmp = -y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -3.7e+67) tmp = t_1; elseif (x <= 2.7e-176) tmp = Float64(-z); elseif (x <= 2.85e+22) tmp = Float64(-y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -3.7e+67) tmp = t_1; elseif (x <= 2.7e-176) tmp = -z; elseif (x <= 2.85e+22) tmp = -y; 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]}, If[LessEqual[x, -3.7e+67], t$95$1, If[LessEqual[x, 2.7e-176], (-z), If[LessEqual[x, 2.85e+22], (-y), t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-176}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 2.85 \cdot 10^{+22}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.6999999999999997e67 or 2.8499999999999999e22 < x Initial program 99.5%
associate--l-99.5%
associate-+l-99.5%
*-commutative99.5%
add-cube-cbrt98.3%
associate-*l*98.4%
fma-neg98.3%
pow298.3%
Applied egg-rr98.3%
Taylor expanded in x around inf 71.6%
pow-base-171.6%
associate-*r*71.6%
*-lft-identity71.6%
Simplified71.6%
if -3.6999999999999997e67 < x < 2.6999999999999998e-176Initial program 100.0%
associate--l-100.0%
associate-+l-100.0%
add-cube-cbrt99.9%
associate-*l*100.0%
fma-neg100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 46.4%
neg-mul-146.4%
Simplified46.4%
if 2.6999999999999998e-176 < x < 2.8499999999999999e22Initial program 100.0%
associate--l-100.0%
associate-+l-100.0%
add-cube-cbrt100.0%
associate-*l*100.0%
fma-neg100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 52.0%
neg-mul-152.0%
Simplified52.0%
Final simplification58.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2.3e+64)
t_1
(if (<= x 2.1e-174)
(- (log t) z)
(if (<= x 2.2e+22) (- (log t) y) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -2.3e+64) {
tmp = t_1;
} else if (x <= 2.1e-174) {
tmp = log(t) - z;
} else if (x <= 2.2e+22) {
tmp = log(t) - y;
} 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) :: tmp
t_1 = x * log(y)
if (x <= (-2.3d+64)) then
tmp = t_1
else if (x <= 2.1d-174) then
tmp = log(t) - z
else if (x <= 2.2d+22) then
tmp = log(t) - y
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 tmp;
if (x <= -2.3e+64) {
tmp = t_1;
} else if (x <= 2.1e-174) {
tmp = Math.log(t) - z;
} else if (x <= 2.2e+22) {
tmp = Math.log(t) - y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -2.3e+64: tmp = t_1 elif x <= 2.1e-174: tmp = math.log(t) - z elif x <= 2.2e+22: tmp = math.log(t) - y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2.3e+64) tmp = t_1; elseif (x <= 2.1e-174) tmp = Float64(log(t) - z); elseif (x <= 2.2e+22) tmp = Float64(log(t) - y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -2.3e+64) tmp = t_1; elseif (x <= 2.1e-174) tmp = log(t) - z; elseif (x <= 2.2e+22) tmp = log(t) - y; 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]}, If[LessEqual[x, -2.3e+64], t$95$1, If[LessEqual[x, 2.1e-174], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 2.2e+22], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{+64}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-174}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+22}:\\
\;\;\;\;\log t - y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.3e64 or 2.2e22 < x Initial program 99.5%
associate--l-99.5%
associate-+l-99.5%
*-commutative99.5%
add-cube-cbrt98.3%
associate-*l*98.4%
fma-neg98.3%
pow298.3%
Applied egg-rr98.3%
Taylor expanded in x around inf 71.6%
pow-base-171.6%
associate-*r*71.6%
*-lft-identity71.6%
Simplified71.6%
if -2.3e64 < x < 2.1000000000000001e-174Initial program 100.0%
Taylor expanded in y around 0 68.6%
+-commutative68.6%
*-commutative68.6%
log-pow60.3%
log-prod60.3%
Simplified60.3%
Taylor expanded in x around 0 66.4%
if 2.1000000000000001e-174 < x < 2.2e22Initial program 100.0%
Taylor expanded in z around 0 71.5%
Taylor expanded in x around 0 71.5%
Final simplification69.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.9e-61) (not (<= x 5e-68))) (- (* x (log y)) y) (- (log t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.9e-61) || !(x <= 5e-68)) {
tmp = (x * log(y)) - y;
} else {
tmp = log(t) - 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 <= (-1.9d-61)) .or. (.not. (x <= 5d-68))) then
tmp = (x * log(y)) - y
else
tmp = log(t) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.9e-61) || !(x <= 5e-68)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.9e-61) or not (x <= 5e-68): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.9e-61) || !(x <= 5e-68)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(log(t) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.9e-61) || ~((x <= 5e-68))) tmp = (x * log(y)) - y; else tmp = log(t) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.9e-61], N[Not[LessEqual[x, 5e-68]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-61} \lor \neg \left(x \leq 5 \cdot 10^{-68}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - z\\
\end{array}
\end{array}
if x < -1.8999999999999999e-61 or 4.99999999999999971e-68 < x Initial program 99.6%
Taylor expanded in z around 0 79.6%
Taylor expanded in x around inf 78.4%
if -1.8999999999999999e-61 < x < 4.99999999999999971e-68Initial program 100.0%
Taylor expanded in y around 0 72.0%
+-commutative72.0%
*-commutative72.0%
log-pow72.0%
log-prod72.0%
Simplified72.0%
Taylor expanded in x around 0 72.0%
Final simplification75.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1.7e+67)
(- t_1 z)
(if (<= x 1960.0) (- (- (log t) y) z) (- t_1 y)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.7e+67) {
tmp = t_1 - z;
} else if (x <= 1960.0) {
tmp = (log(t) - y) - z;
} else {
tmp = t_1 - 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)
if (x <= (-1.7d+67)) then
tmp = t_1 - z
else if (x <= 1960.0d0) then
tmp = (log(t) - y) - z
else
tmp = t_1 - 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);
double tmp;
if (x <= -1.7e+67) {
tmp = t_1 - z;
} else if (x <= 1960.0) {
tmp = (Math.log(t) - y) - z;
} else {
tmp = t_1 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.7e+67: tmp = t_1 - z elif x <= 1960.0: tmp = (math.log(t) - y) - z else: tmp = t_1 - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.7e+67) tmp = Float64(t_1 - z); elseif (x <= 1960.0) tmp = Float64(Float64(log(t) - y) - z); else tmp = Float64(t_1 - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -1.7e+67) tmp = t_1 - z; elseif (x <= 1960.0) tmp = (log(t) - y) - z; else tmp = t_1 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e+67], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[x, 1960.0], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(t$95$1 - y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+67}:\\
\;\;\;\;t_1 - z\\
\mathbf{elif}\;x \leq 1960:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t_1 - y\\
\end{array}
\end{array}
if x < -1.7000000000000001e67Initial program 99.5%
Taylor expanded in y around 0 89.6%
Taylor expanded in x around inf 89.6%
if -1.7000000000000001e67 < x < 1960Initial program 100.0%
Taylor expanded in x around 0 98.3%
associate--r+98.3%
Simplified98.3%
if 1960 < x Initial program 99.5%
Taylor expanded in z around 0 88.3%
Taylor expanded in x around inf 88.3%
Final simplification94.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 1.04e+127) (- t_1 z) (- t_1 y))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 1.04e+127) {
tmp = t_1 - z;
} else {
tmp = t_1 - 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)
if (y <= 1.04d+127) then
tmp = t_1 - z
else
tmp = t_1 - 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);
double tmp;
if (y <= 1.04e+127) {
tmp = t_1 - z;
} else {
tmp = t_1 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 1.04e+127: tmp = t_1 - z else: tmp = t_1 - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 1.04e+127) tmp = Float64(t_1 - z); else tmp = Float64(t_1 - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 1.04e+127) tmp = t_1 - z; else tmp = t_1 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.04e+127], N[(t$95$1 - z), $MachinePrecision], N[(t$95$1 - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 1.04 \cdot 10^{+127}:\\
\;\;\;\;t_1 - z\\
\mathbf{else}:\\
\;\;\;\;t_1 - y\\
\end{array}
\end{array}
if y < 1.04e127Initial program 99.7%
Taylor expanded in y around 0 91.4%
Taylor expanded in x around inf 75.7%
if 1.04e127 < y Initial program 99.9%
Taylor expanded in z around 0 89.3%
Taylor expanded in x around inf 89.3%
Final simplification79.4%
(FPCore (x y z t) :precision binary64 (if (<= y 1.15e+133) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.15e+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 (y <= 1.15d+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 (y <= 1.15e+133) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.15e+133: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.15e+133) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.15e+133) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.15e+133], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15 \cdot 10^{+133}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.14999999999999995e133Initial program 99.7%
associate--l-99.7%
associate-+l-99.7%
add-cube-cbrt99.2%
associate-*l*99.2%
fma-neg99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 37.3%
neg-mul-137.3%
Simplified37.3%
if 1.14999999999999995e133 < y Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
add-cube-cbrt99.6%
associate-*l*99.6%
fma-neg99.6%
pow299.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 75.4%
neg-mul-175.4%
Simplified75.4%
Final simplification47.2%
(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.8%
associate--l-99.8%
associate-+l-99.8%
add-cube-cbrt99.3%
associate-*l*99.3%
fma-neg99.3%
pow299.3%
Applied egg-rr99.3%
Taylor expanded in y around inf 26.7%
neg-mul-126.7%
Simplified26.7%
Final simplification26.7%
herbie shell --seed 2023199
(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)))