
(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 10 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.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (- (log t) y) z)))
(if (<= x -1.32e+79)
t_1
(if (<= x 5.1e+17)
t_2
(if (<= x 1.75e+59) (+ (log t) t_1) (if (<= x 1.2e+119) 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) - z;
double tmp;
if (x <= -1.32e+79) {
tmp = t_1;
} else if (x <= 5.1e+17) {
tmp = t_2;
} else if (x <= 1.75e+59) {
tmp = log(t) + t_1;
} else if (x <= 1.2e+119) {
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) - z
if (x <= (-1.32d+79)) then
tmp = t_1
else if (x <= 5.1d+17) then
tmp = t_2
else if (x <= 1.75d+59) then
tmp = log(t) + t_1
else if (x <= 1.2d+119) 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) - z;
double tmp;
if (x <= -1.32e+79) {
tmp = t_1;
} else if (x <= 5.1e+17) {
tmp = t_2;
} else if (x <= 1.75e+59) {
tmp = Math.log(t) + t_1;
} else if (x <= 1.2e+119) {
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) - z tmp = 0 if x <= -1.32e+79: tmp = t_1 elif x <= 5.1e+17: tmp = t_2 elif x <= 1.75e+59: tmp = math.log(t) + t_1 elif x <= 1.2e+119: 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(log(t) - y) - z) tmp = 0.0 if (x <= -1.32e+79) tmp = t_1; elseif (x <= 5.1e+17) tmp = t_2; elseif (x <= 1.75e+59) tmp = Float64(log(t) + t_1); elseif (x <= 1.2e+119) 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) - z; tmp = 0.0; if (x <= -1.32e+79) tmp = t_1; elseif (x <= 5.1e+17) tmp = t_2; elseif (x <= 1.75e+59) tmp = log(t) + t_1; elseif (x <= 1.2e+119) 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[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -1.32e+79], t$95$1, If[LessEqual[x, 5.1e+17], t$95$2, If[LessEqual[x, 1.75e+59], N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, 1.2e+119], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(\log t - y\right) - z\\
\mathbf{if}\;x \leq -1.32 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{+17}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+59}:\\
\;\;\;\;\log t + t_1\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+119}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.32e79 or 1.2e119 < x Initial program 99.7%
associate--l-99.7%
associate-+l-99.7%
add-cube-cbrt98.4%
associate-*r*98.4%
fma-neg98.4%
pow298.4%
Applied egg-rr98.4%
Taylor expanded in x around inf 73.4%
pow-base-173.4%
*-lft-identity73.4%
Simplified73.4%
if -1.32e79 < x < 5.1e17 or 1.75e59 < x < 1.2e119Initial program 100.0%
Taylor expanded in x around 0 94.5%
associate--r+94.5%
Simplified94.5%
if 5.1e17 < x < 1.75e59Initial program 99.4%
Taylor expanded in y around 0 89.5%
Taylor expanded in z around 0 70.4%
Final simplification86.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.8e-16) (not (<= x 5e+17))) (- (+ (log t) (* x (log y))) y) (- (- (log t) y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e-16) || !(x <= 5e+17)) {
tmp = (log(t) + (x * log(y))) - y;
} else {
tmp = (log(t) - 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 <= (-2.8d-16)) .or. (.not. (x <= 5d+17))) then
tmp = (log(t) + (x * log(y))) - y
else
tmp = (log(t) - y) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e-16) || !(x <= 5e+17)) {
tmp = (Math.log(t) + (x * Math.log(y))) - y;
} else {
tmp = (Math.log(t) - y) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.8e-16) or not (x <= 5e+17): tmp = (math.log(t) + (x * math.log(y))) - y else: tmp = (math.log(t) - y) - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.8e-16) || !(x <= 5e+17)) tmp = Float64(Float64(log(t) + Float64(x * log(y))) - y); else tmp = Float64(Float64(log(t) - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.8e-16) || ~((x <= 5e+17))) tmp = (log(t) + (x * log(y))) - y; else tmp = (log(t) - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.8e-16], N[Not[LessEqual[x, 5e+17]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-16} \lor \neg \left(x \leq 5 \cdot 10^{+17}\right):\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\end{array}
\end{array}
if x < -2.8000000000000001e-16 or 5e17 < x Initial program 99.7%
Taylor expanded in z around 0 83.8%
if -2.8000000000000001e-16 < x < 5e17Initial program 100.0%
Taylor expanded in x around 0 99.6%
associate--r+99.6%
Simplified99.6%
Final simplification92.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (log t) (* x (log y))))) (if (<= y 6.5e+19) (- t_1 z) (- t_1 y))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) + (x * log(y));
double tmp;
if (y <= 6.5e+19) {
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 = log(t) + (x * log(y))
if (y <= 6.5d+19) 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 = Math.log(t) + (x * Math.log(y));
double tmp;
if (y <= 6.5e+19) {
tmp = t_1 - z;
} else {
tmp = t_1 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) + (x * math.log(y)) tmp = 0 if y <= 6.5e+19: tmp = t_1 - z else: tmp = t_1 - y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) + Float64(x * log(y))) tmp = 0.0 if (y <= 6.5e+19) 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 = log(t) + (x * log(y)); tmp = 0.0; if (y <= 6.5e+19) tmp = t_1 - z; else tmp = t_1 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6.5e+19], N[(t$95$1 - z), $MachinePrecision], N[(t$95$1 - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t + x \cdot \log y\\
\mathbf{if}\;y \leq 6.5 \cdot 10^{+19}:\\
\;\;\;\;t_1 - z\\
\mathbf{else}:\\
\;\;\;\;t_1 - y\\
\end{array}
\end{array}
if y < 6.5e19Initial program 99.8%
Taylor expanded in y around 0 98.1%
if 6.5e19 < y Initial program 99.9%
Taylor expanded in z around 0 83.4%
Final simplification91.5%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -4.8e+79)
(not (or (<= x 3e+17) (and (not (<= x 2e+59)) (<= x 1.55e+119)))))
(* x (log y))
(- (- (log t) y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.8e+79) || !((x <= 3e+17) || (!(x <= 2e+59) && (x <= 1.55e+119)))) {
tmp = x * log(y);
} else {
tmp = (log(t) - 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 <= (-4.8d+79)) .or. (.not. (x <= 3d+17) .or. (.not. (x <= 2d+59)) .and. (x <= 1.55d+119))) then
tmp = x * log(y)
else
tmp = (log(t) - y) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.8e+79) || !((x <= 3e+17) || (!(x <= 2e+59) && (x <= 1.55e+119)))) {
tmp = x * Math.log(y);
} else {
tmp = (Math.log(t) - y) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.8e+79) or not ((x <= 3e+17) or (not (x <= 2e+59) and (x <= 1.55e+119))): tmp = x * math.log(y) else: tmp = (math.log(t) - y) - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.8e+79) || !((x <= 3e+17) || (!(x <= 2e+59) && (x <= 1.55e+119)))) tmp = Float64(x * log(y)); else tmp = Float64(Float64(log(t) - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4.8e+79) || ~(((x <= 3e+17) || (~((x <= 2e+59)) && (x <= 1.55e+119))))) tmp = x * log(y); else tmp = (log(t) - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.8e+79], N[Not[Or[LessEqual[x, 3e+17], And[N[Not[LessEqual[x, 2e+59]], $MachinePrecision], LessEqual[x, 1.55e+119]]]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+79} \lor \neg \left(x \leq 3 \cdot 10^{+17} \lor \neg \left(x \leq 2 \cdot 10^{+59}\right) \land x \leq 1.55 \cdot 10^{+119}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\end{array}
\end{array}
if x < -4.79999999999999971e79 or 3e17 < x < 1.99999999999999994e59 or 1.54999999999999998e119 < x Initial program 99.6%
associate--l-99.6%
associate-+l-99.6%
add-cube-cbrt98.4%
associate-*r*98.4%
fma-neg98.4%
pow298.4%
Applied egg-rr98.4%
Taylor expanded in x around inf 73.1%
pow-base-173.1%
*-lft-identity73.1%
Simplified73.1%
if -4.79999999999999971e79 < x < 3e17 or 1.99999999999999994e59 < x < 1.54999999999999998e119Initial program 100.0%
Taylor expanded in x around 0 94.5%
associate--r+94.5%
Simplified94.5%
Final simplification86.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= y 1.18e-287)
t_1
(if (<= y 5.3e-163) (- z) (if (<= y 4.7e+67) t_1 (- y))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 1.18e-287) {
tmp = t_1;
} else if (y <= 5.3e-163) {
tmp = -z;
} else if (y <= 4.7e+67) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (y <= 1.18d-287) then
tmp = t_1
else if (y <= 5.3d-163) then
tmp = -z
else if (y <= 4.7d+67) then
tmp = t_1
else
tmp = -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.18e-287) {
tmp = t_1;
} else if (y <= 5.3e-163) {
tmp = -z;
} else if (y <= 4.7e+67) {
tmp = t_1;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 1.18e-287: tmp = t_1 elif y <= 5.3e-163: tmp = -z elif y <= 4.7e+67: tmp = t_1 else: tmp = -y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 1.18e-287) tmp = t_1; elseif (y <= 5.3e-163) tmp = Float64(-z); elseif (y <= 4.7e+67) tmp = t_1; else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 1.18e-287) tmp = t_1; elseif (y <= 5.3e-163) tmp = -z; elseif (y <= 4.7e+67) tmp = t_1; else tmp = -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.18e-287], t$95$1, If[LessEqual[y, 5.3e-163], (-z), If[LessEqual[y, 4.7e+67], t$95$1, (-y)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 1.18 \cdot 10^{-287}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-163}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.18000000000000003e-287 or 5.30000000000000016e-163 < y < 4.70000000000000017e67Initial program 99.7%
associate--l-99.7%
associate-+l-99.7%
add-cube-cbrt98.9%
associate-*r*98.9%
fma-neg98.9%
pow298.9%
Applied egg-rr98.9%
Taylor expanded in x around inf 46.6%
pow-base-146.6%
*-lft-identity46.6%
Simplified46.6%
if 1.18000000000000003e-287 < y < 5.30000000000000016e-163Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
add-cube-cbrt99.5%
associate-*r*99.6%
fma-neg99.6%
pow299.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 50.2%
neg-mul-150.2%
Simplified50.2%
if 4.70000000000000017e67 < y Initial program 100.0%
associate--l-100.0%
associate-+l-100.0%
add-cube-cbrt99.7%
associate-*r*99.7%
fma-neg99.7%
pow299.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 66.8%
neg-mul-166.8%
Simplified66.8%
Final simplification55.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) z)))
(if (<= y 3e-106)
t_1
(if (<= y 5.8e-53) (* x (log y)) (if (<= y 3.5e+19) t_1 (- y))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - z;
double tmp;
if (y <= 3e-106) {
tmp = t_1;
} else if (y <= 5.8e-53) {
tmp = x * log(y);
} else if (y <= 3.5e+19) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = log(t) - z
if (y <= 3d-106) then
tmp = t_1
else if (y <= 5.8d-53) then
tmp = x * log(y)
else if (y <= 3.5d+19) then
tmp = t_1
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - z;
double tmp;
if (y <= 3e-106) {
tmp = t_1;
} else if (y <= 5.8e-53) {
tmp = x * Math.log(y);
} else if (y <= 3.5e+19) {
tmp = t_1;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - z tmp = 0 if y <= 3e-106: tmp = t_1 elif y <= 5.8e-53: tmp = x * math.log(y) elif y <= 3.5e+19: tmp = t_1 else: tmp = -y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - z) tmp = 0.0 if (y <= 3e-106) tmp = t_1; elseif (y <= 5.8e-53) tmp = Float64(x * log(y)); elseif (y <= 3.5e+19) tmp = t_1; else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - z; tmp = 0.0; if (y <= 3e-106) tmp = t_1; elseif (y <= 5.8e-53) tmp = x * log(y); elseif (y <= 3.5e+19) tmp = t_1; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[y, 3e-106], t$95$1, If[LessEqual[y, 5.8e-53], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+19], t$95$1, (-y)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - z\\
\mathbf{if}\;y \leq 3 \cdot 10^{-106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-53}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 3.00000000000000019e-106 or 5.7999999999999996e-53 < y < 3.5e19Initial program 99.9%
Taylor expanded in z around inf 66.7%
neg-mul-166.7%
Simplified66.7%
Taylor expanded in z around 0 66.7%
neg-mul-166.7%
+-commutative66.7%
sub-neg66.7%
Simplified66.7%
if 3.00000000000000019e-106 < y < 5.7999999999999996e-53Initial program 99.6%
associate--l-99.6%
associate-+l-99.6%
add-cube-cbrt98.1%
associate-*r*98.1%
fma-neg98.1%
pow298.1%
Applied egg-rr98.1%
Taylor expanded in x around inf 66.3%
pow-base-166.3%
*-lft-identity66.3%
Simplified66.3%
if 3.5e19 < y Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
add-cube-cbrt99.6%
associate-*r*99.6%
fma-neg99.6%
pow299.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 61.6%
neg-mul-161.6%
Simplified61.6%
Final simplification64.4%
(FPCore (x y z t) :precision binary64 (if (<= y 1e-74) (- z) (if (<= y 9e-41) (log t) (if (<= y 7.8e+18) (- z) (- y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1e-74) {
tmp = -z;
} else if (y <= 9e-41) {
tmp = log(t);
} else if (y <= 7.8e+18) {
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 <= 1d-74) then
tmp = -z
else if (y <= 9d-41) then
tmp = log(t)
else if (y <= 7.8d+18) 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 <= 1e-74) {
tmp = -z;
} else if (y <= 9e-41) {
tmp = Math.log(t);
} else if (y <= 7.8e+18) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1e-74: tmp = -z elif y <= 9e-41: tmp = math.log(t) elif y <= 7.8e+18: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1e-74) tmp = Float64(-z); elseif (y <= 9e-41) tmp = log(t); elseif (y <= 7.8e+18) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1e-74) tmp = -z; elseif (y <= 9e-41) tmp = log(t); elseif (y <= 7.8e+18) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1e-74], (-z), If[LessEqual[y, 9e-41], N[Log[t], $MachinePrecision], If[LessEqual[y, 7.8e+18], (-z), (-y)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{-74}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-41}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+18}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 9.99999999999999958e-75 or 9e-41 < y < 7.8e18Initial program 99.8%
associate--l-99.8%
associate-+l-99.8%
add-cube-cbrt99.2%
associate-*r*99.2%
fma-neg99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 42.1%
neg-mul-142.1%
Simplified42.1%
if 9.99999999999999958e-75 < y < 9e-41Initial program 99.7%
Taylor expanded in z around inf 50.2%
neg-mul-150.2%
Simplified50.2%
Taylor expanded in z around 0 40.4%
if 7.8e18 < y Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
add-cube-cbrt99.6%
associate-*r*99.6%
fma-neg99.6%
pow299.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 61.4%
neg-mul-161.4%
Simplified61.4%
Final simplification50.8%
(FPCore (x y z t) :precision binary64 (if (<= y 4.3e+18) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.3e+18) {
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 <= 4.3d+18) 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 <= 4.3e+18) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4.3e+18: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4.3e+18) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 4.3e+18) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4.3e+18], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{+18}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 4.3e18Initial program 99.8%
associate--l-99.8%
associate-+l-99.8%
add-cube-cbrt99.1%
associate-*r*99.1%
fma-neg99.1%
pow299.1%
Applied egg-rr99.1%
Taylor expanded in z around inf 38.2%
neg-mul-138.2%
Simplified38.2%
if 4.3e18 < y Initial program 99.9%
associate--l-99.9%
associate-+l-99.9%
add-cube-cbrt99.6%
associate-*r*99.6%
fma-neg99.6%
pow299.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 61.4%
neg-mul-161.4%
Simplified61.4%
Final simplification48.8%
(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%
associate-+l-99.9%
add-cube-cbrt99.3%
associate-*r*99.3%
fma-neg99.3%
pow299.3%
Applied egg-rr99.3%
Taylor expanded in y around inf 29.7%
neg-mul-129.7%
Simplified29.7%
Final simplification29.7%
herbie shell --seed 2023240
(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)))