
(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 11 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 (- (log t) (+ y z)))
(t_2 (+ (log t) (* x (log y))))
(t_3 (- t_2 z)))
(if (<= y 2.5e+21)
t_3
(if (<= y 4.4e+49)
t_1
(if (<= y 6.5e+77) t_3 (if (<= y 2.2e+175) t_1 (- t_2 y)))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - (y + z);
double t_2 = log(t) + (x * log(y));
double t_3 = t_2 - z;
double tmp;
if (y <= 2.5e+21) {
tmp = t_3;
} else if (y <= 4.4e+49) {
tmp = t_1;
} else if (y <= 6.5e+77) {
tmp = t_3;
} else if (y <= 2.2e+175) {
tmp = t_1;
} else {
tmp = t_2 - 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = log(t) - (y + z)
t_2 = log(t) + (x * log(y))
t_3 = t_2 - z
if (y <= 2.5d+21) then
tmp = t_3
else if (y <= 4.4d+49) then
tmp = t_1
else if (y <= 6.5d+77) then
tmp = t_3
else if (y <= 2.2d+175) then
tmp = t_1
else
tmp = t_2 - 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) - (y + z);
double t_2 = Math.log(t) + (x * Math.log(y));
double t_3 = t_2 - z;
double tmp;
if (y <= 2.5e+21) {
tmp = t_3;
} else if (y <= 4.4e+49) {
tmp = t_1;
} else if (y <= 6.5e+77) {
tmp = t_3;
} else if (y <= 2.2e+175) {
tmp = t_1;
} else {
tmp = t_2 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - (y + z) t_2 = math.log(t) + (x * math.log(y)) t_3 = t_2 - z tmp = 0 if y <= 2.5e+21: tmp = t_3 elif y <= 4.4e+49: tmp = t_1 elif y <= 6.5e+77: tmp = t_3 elif y <= 2.2e+175: tmp = t_1 else: tmp = t_2 - y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - Float64(y + z)) t_2 = Float64(log(t) + Float64(x * log(y))) t_3 = Float64(t_2 - z) tmp = 0.0 if (y <= 2.5e+21) tmp = t_3; elseif (y <= 4.4e+49) tmp = t_1; elseif (y <= 6.5e+77) tmp = t_3; elseif (y <= 2.2e+175) tmp = t_1; else tmp = Float64(t_2 - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - (y + z); t_2 = log(t) + (x * log(y)); t_3 = t_2 - z; tmp = 0.0; if (y <= 2.5e+21) tmp = t_3; elseif (y <= 4.4e+49) tmp = t_1; elseif (y <= 6.5e+77) tmp = t_3; elseif (y <= 2.2e+175) tmp = t_1; else tmp = t_2 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - z), $MachinePrecision]}, If[LessEqual[y, 2.5e+21], t$95$3, If[LessEqual[y, 4.4e+49], t$95$1, If[LessEqual[y, 6.5e+77], t$95$3, If[LessEqual[y, 2.2e+175], t$95$1, N[(t$95$2 - y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - \left(y + z\right)\\
t_2 := \log t + x \cdot \log y\\
t_3 := t_2 - z\\
\mathbf{if}\;y \leq 2.5 \cdot 10^{+21}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+77}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+175}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 - y\\
\end{array}
\end{array}
if y < 2.5e21 or 4.4000000000000001e49 < y < 6.5e77Initial program 99.7%
Taylor expanded in y around 0 98.8%
if 2.5e21 < y < 4.4000000000000001e49 or 6.5e77 < y < 2.1999999999999999e175Initial program 100.0%
Taylor expanded in x around 0 87.9%
if 2.1999999999999999e175 < y Initial program 100.0%
Taylor expanded in z around 0 93.6%
Final simplification95.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.5e+14) (not (<= x 6.5e+69))) (- (+ (log t) (* x (log y))) y) (- (+ (* y -2.0) (+ y (log t))) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.5e+14) || !(x <= 6.5e+69)) {
tmp = (log(t) + (x * log(y))) - y;
} else {
tmp = ((y * -2.0) + (y + 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.5d+14)) .or. (.not. (x <= 6.5d+69))) then
tmp = (log(t) + (x * log(y))) - y
else
tmp = ((y * (-2.0d0)) + (y + 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.5e+14) || !(x <= 6.5e+69)) {
tmp = (Math.log(t) + (x * Math.log(y))) - y;
} else {
tmp = ((y * -2.0) + (y + Math.log(t))) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.5e+14) or not (x <= 6.5e+69): tmp = (math.log(t) + (x * math.log(y))) - y else: tmp = ((y * -2.0) + (y + math.log(t))) - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.5e+14) || !(x <= 6.5e+69)) tmp = Float64(Float64(log(t) + Float64(x * log(y))) - y); else tmp = Float64(Float64(Float64(y * -2.0) + Float64(y + log(t))) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.5e+14) || ~((x <= 6.5e+69))) tmp = (log(t) + (x * log(y))) - y; else tmp = ((y * -2.0) + (y + log(t))) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.5e+14], N[Not[LessEqual[x, 6.5e+69]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[(N[(y * -2.0), $MachinePrecision] + N[(y + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+14} \lor \neg \left(x \leq 6.5 \cdot 10^{+69}\right):\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot -2 + \left(y + \log t\right)\right) - z\\
\end{array}
\end{array}
if x < -1.5e14 or 6.5000000000000001e69 < x Initial program 99.7%
Taylor expanded in z around 0 86.0%
if -1.5e14 < x < 6.5000000000000001e69Initial program 100.0%
flip--63.2%
clear-num63.1%
associate-+l-63.1%
pow263.1%
Applied egg-rr63.1%
Taylor expanded in x around inf 100.0%
Taylor expanded in x around 0 97.7%
Final simplification92.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1.22e+26)
t_1
(if (<= x -1.8e-104)
(- z)
(if (<= x -1.8e-226)
(- y)
(if (<= x 3.05e-260) (- z) (if (<= x 3e+99) (- y) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.22e+26) {
tmp = t_1;
} else if (x <= -1.8e-104) {
tmp = -z;
} else if (x <= -1.8e-226) {
tmp = -y;
} else if (x <= 3.05e-260) {
tmp = -z;
} else if (x <= 3e+99) {
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 <= (-1.22d+26)) then
tmp = t_1
else if (x <= (-1.8d-104)) then
tmp = -z
else if (x <= (-1.8d-226)) then
tmp = -y
else if (x <= 3.05d-260) then
tmp = -z
else if (x <= 3d+99) 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 <= -1.22e+26) {
tmp = t_1;
} else if (x <= -1.8e-104) {
tmp = -z;
} else if (x <= -1.8e-226) {
tmp = -y;
} else if (x <= 3.05e-260) {
tmp = -z;
} else if (x <= 3e+99) {
tmp = -y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.22e+26: tmp = t_1 elif x <= -1.8e-104: tmp = -z elif x <= -1.8e-226: tmp = -y elif x <= 3.05e-260: tmp = -z elif x <= 3e+99: 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 <= -1.22e+26) tmp = t_1; elseif (x <= -1.8e-104) tmp = Float64(-z); elseif (x <= -1.8e-226) tmp = Float64(-y); elseif (x <= 3.05e-260) tmp = Float64(-z); elseif (x <= 3e+99) 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 <= -1.22e+26) tmp = t_1; elseif (x <= -1.8e-104) tmp = -z; elseif (x <= -1.8e-226) tmp = -y; elseif (x <= 3.05e-260) tmp = -z; elseif (x <= 3e+99) 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, -1.22e+26], t$95$1, If[LessEqual[x, -1.8e-104], (-z), If[LessEqual[x, -1.8e-226], (-y), If[LessEqual[x, 3.05e-260], (-z), If[LessEqual[x, 3e+99], (-y), t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.22 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-104}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-226}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq 3.05 \cdot 10^{-260}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+99}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.2200000000000001e26 or 3.00000000000000014e99 < x Initial program 99.7%
flip--18.5%
clear-num18.5%
associate-+l-18.5%
pow218.5%
Applied egg-rr18.5%
Taylor expanded in x around inf 99.7%
Taylor expanded in x around inf 65.8%
if -1.2200000000000001e26 < x < -1.7999999999999999e-104 or -1.79999999999999997e-226 < x < 3.0500000000000001e-260Initial program 100.0%
Taylor expanded in z around inf 50.3%
neg-mul-150.3%
Simplified50.3%
if -1.7999999999999999e-104 < x < -1.79999999999999997e-226 or 3.0500000000000001e-260 < x < 3.00000000000000014e99Initial program 100.0%
flip--61.9%
clear-num61.8%
associate-+l-61.8%
pow261.9%
Applied egg-rr61.9%
Taylor expanded in x around inf 100.0%
Taylor expanded in y around inf 49.7%
mul-1-neg49.7%
Simplified49.7%
Final simplification57.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) y)) (t_2 (* x (log y))) (t_3 (- (log t) z)))
(if (<= x -9e+25)
t_2
(if (<= x -7.5e-104)
t_3
(if (<= x -1.8e-226)
t_1
(if (<= x 9.8e-262) t_3 (if (<= x 6.5e+99) t_1 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 = log(t) - z;
double tmp;
if (x <= -9e+25) {
tmp = t_2;
} else if (x <= -7.5e-104) {
tmp = t_3;
} else if (x <= -1.8e-226) {
tmp = t_1;
} else if (x <= 9.8e-262) {
tmp = t_3;
} else if (x <= 6.5e+99) {
tmp = t_1;
} 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 = log(t) - z
if (x <= (-9d+25)) then
tmp = t_2
else if (x <= (-7.5d-104)) then
tmp = t_3
else if (x <= (-1.8d-226)) then
tmp = t_1
else if (x <= 9.8d-262) then
tmp = t_3
else if (x <= 6.5d+99) then
tmp = t_1
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 = Math.log(t) - z;
double tmp;
if (x <= -9e+25) {
tmp = t_2;
} else if (x <= -7.5e-104) {
tmp = t_3;
} else if (x <= -1.8e-226) {
tmp = t_1;
} else if (x <= 9.8e-262) {
tmp = t_3;
} else if (x <= 6.5e+99) {
tmp = t_1;
} 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 = math.log(t) - z tmp = 0 if x <= -9e+25: tmp = t_2 elif x <= -7.5e-104: tmp = t_3 elif x <= -1.8e-226: tmp = t_1 elif x <= 9.8e-262: tmp = t_3 elif x <= 6.5e+99: tmp = t_1 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(log(t) - z) tmp = 0.0 if (x <= -9e+25) tmp = t_2; elseif (x <= -7.5e-104) tmp = t_3; elseif (x <= -1.8e-226) tmp = t_1; elseif (x <= 9.8e-262) tmp = t_3; elseif (x <= 6.5e+99) tmp = t_1; 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 = log(t) - z; tmp = 0.0; if (x <= -9e+25) tmp = t_2; elseif (x <= -7.5e-104) tmp = t_3; elseif (x <= -1.8e-226) tmp = t_1; elseif (x <= 9.8e-262) tmp = t_3; elseif (x <= 6.5e+99) tmp = t_1; 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[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -9e+25], t$95$2, If[LessEqual[x, -7.5e-104], t$95$3, If[LessEqual[x, -1.8e-226], t$95$1, If[LessEqual[x, 9.8e-262], t$95$3, If[LessEqual[x, 6.5e+99], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
t_2 := x \cdot \log y\\
t_3 := \log t - z\\
\mathbf{if}\;x \leq -9 \cdot 10^{+25}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-104}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-226}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.8 \cdot 10^{-262}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -9.0000000000000006e25 or 6.5000000000000004e99 < x Initial program 99.7%
flip--18.5%
clear-num18.5%
associate-+l-18.5%
pow218.5%
Applied egg-rr18.5%
Taylor expanded in x around inf 99.7%
Taylor expanded in x around inf 65.8%
if -9.0000000000000006e25 < x < -7.5e-104 or -1.79999999999999997e-226 < x < 9.8000000000000005e-262Initial program 100.0%
Taylor expanded in y around 0 81.4%
Taylor expanded in x around 0 80.9%
if -7.5e-104 < x < -1.79999999999999997e-226 or 9.8000000000000005e-262 < x < 6.5000000000000004e99Initial program 100.0%
flip--62.3%
clear-num62.3%
associate-+l-62.3%
pow262.3%
Applied egg-rr62.3%
Taylor expanded in z around 0 49.7%
Taylor expanded in y around inf 72.0%
neg-mul-172.0%
Simplified72.0%
Final simplification71.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.72e+186) (not (<= x 3.3e+169))) (* x (log y)) (- (+ (* y -2.0) (+ y (log t))) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.72e+186) || !(x <= 3.3e+169)) {
tmp = x * log(y);
} else {
tmp = ((y * -2.0) + (y + 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.72d+186)) .or. (.not. (x <= 3.3d+169))) then
tmp = x * log(y)
else
tmp = ((y * (-2.0d0)) + (y + 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.72e+186) || !(x <= 3.3e+169)) {
tmp = x * Math.log(y);
} else {
tmp = ((y * -2.0) + (y + Math.log(t))) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.72e+186) or not (x <= 3.3e+169): tmp = x * math.log(y) else: tmp = ((y * -2.0) + (y + math.log(t))) - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.72e+186) || !(x <= 3.3e+169)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(Float64(y * -2.0) + Float64(y + log(t))) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.72e+186) || ~((x <= 3.3e+169))) tmp = x * log(y); else tmp = ((y * -2.0) + (y + log(t))) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.72e+186], N[Not[LessEqual[x, 3.3e+169]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * -2.0), $MachinePrecision] + N[(y + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.72 \cdot 10^{+186} \lor \neg \left(x \leq 3.3 \cdot 10^{+169}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot -2 + \left(y + \log t\right)\right) - z\\
\end{array}
\end{array}
if x < -1.72e186 or 3.2999999999999997e169 < x Initial program 99.6%
flip--5.9%
clear-num5.9%
associate-+l-5.9%
pow25.9%
Applied egg-rr5.9%
Taylor expanded in x around inf 99.6%
Taylor expanded in x around inf 86.4%
if -1.72e186 < x < 3.2999999999999997e169Initial program 99.9%
flip--53.3%
clear-num53.3%
associate-+l-53.3%
pow253.3%
Applied egg-rr53.3%
Taylor expanded in x around inf 99.9%
Taylor expanded in x around 0 84.7%
Final simplification85.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) z)))
(if (<= y 1.15e-275)
t_1
(if (<= y 5e-229) (* x (log y)) (if (<= y 1.2e+27) t_1 (- y))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - z;
double tmp;
if (y <= 1.15e-275) {
tmp = t_1;
} else if (y <= 5e-229) {
tmp = x * log(y);
} else if (y <= 1.2e+27) {
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 <= 1.15d-275) then
tmp = t_1
else if (y <= 5d-229) then
tmp = x * log(y)
else if (y <= 1.2d+27) 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 <= 1.15e-275) {
tmp = t_1;
} else if (y <= 5e-229) {
tmp = x * Math.log(y);
} else if (y <= 1.2e+27) {
tmp = t_1;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - z tmp = 0 if y <= 1.15e-275: tmp = t_1 elif y <= 5e-229: tmp = x * math.log(y) elif y <= 1.2e+27: 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 <= 1.15e-275) tmp = t_1; elseif (y <= 5e-229) tmp = Float64(x * log(y)); elseif (y <= 1.2e+27) 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 <= 1.15e-275) tmp = t_1; elseif (y <= 5e-229) tmp = x * log(y); elseif (y <= 1.2e+27) 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, 1.15e-275], t$95$1, If[LessEqual[y, 5e-229], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+27], t$95$1, (-y)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - z\\
\mathbf{if}\;y \leq 1.15 \cdot 10^{-275}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-229}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.14999999999999995e-275 or 5.00000000000000016e-229 < y < 1.19999999999999999e27Initial program 99.8%
Taylor expanded in y around 0 97.8%
Taylor expanded in x around 0 62.3%
if 1.14999999999999995e-275 < y < 5.00000000000000016e-229Initial program 99.7%
flip--46.2%
clear-num46.2%
associate-+l-46.2%
pow246.2%
Applied egg-rr46.2%
Taylor expanded in x around inf 99.7%
Taylor expanded in x around inf 61.1%
if 1.19999999999999999e27 < y Initial program 99.9%
flip--27.0%
clear-num27.0%
associate-+l-27.0%
pow227.0%
Applied egg-rr27.0%
Taylor expanded in x around inf 99.9%
Taylor expanded in y around inf 66.4%
mul-1-neg66.4%
Simplified66.4%
Final simplification64.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -8.3e+186) (not (<= x 6.2e+168))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8.3e+186) || !(x <= 6.2e+168)) {
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 <= (-8.3d+186)) .or. (.not. (x <= 6.2d+168))) 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 <= -8.3e+186) || !(x <= 6.2e+168)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -8.3e+186) or not (x <= 6.2e+168): 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 <= -8.3e+186) || !(x <= 6.2e+168)) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -8.3e+186) || ~((x <= 6.2e+168))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8.3e+186], N[Not[LessEqual[x, 6.2e+168]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.3 \cdot 10^{+186} \lor \neg \left(x \leq 6.2 \cdot 10^{+168}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -8.3000000000000003e186 or 6.19999999999999993e168 < x Initial program 99.6%
flip--5.9%
clear-num5.9%
associate-+l-5.9%
pow25.9%
Applied egg-rr5.9%
Taylor expanded in x around inf 99.6%
Taylor expanded in x around inf 86.4%
if -8.3000000000000003e186 < x < 6.19999999999999993e168Initial program 99.9%
Taylor expanded in x around 0 84.7%
Final simplification85.0%
(FPCore (x y z t) :precision binary64 (if (<= y 3e-175) (- z) (if (<= y 1.5e-38) (log t) (if (<= y 1.4e+27) (- z) (- y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3e-175) {
tmp = -z;
} else if (y <= 1.5e-38) {
tmp = log(t);
} else if (y <= 1.4e+27) {
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 <= 3d-175) then
tmp = -z
else if (y <= 1.5d-38) then
tmp = log(t)
else if (y <= 1.4d+27) 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 <= 3e-175) {
tmp = -z;
} else if (y <= 1.5e-38) {
tmp = Math.log(t);
} else if (y <= 1.4e+27) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3e-175: tmp = -z elif y <= 1.5e-38: tmp = math.log(t) elif y <= 1.4e+27: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3e-175) tmp = Float64(-z); elseif (y <= 1.5e-38) tmp = log(t); elseif (y <= 1.4e+27) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3e-175) tmp = -z; elseif (y <= 1.5e-38) tmp = log(t); elseif (y <= 1.4e+27) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3e-175], (-z), If[LessEqual[y, 1.5e-38], N[Log[t], $MachinePrecision], If[LessEqual[y, 1.4e+27], (-z), (-y)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{-175}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-38}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+27}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 3e-175 or 1.49999999999999994e-38 < y < 1.4e27Initial program 99.8%
Taylor expanded in z around inf 43.0%
neg-mul-143.0%
Simplified43.0%
if 3e-175 < y < 1.49999999999999994e-38Initial program 99.7%
Taylor expanded in y around 0 99.7%
Taylor expanded in x around 0 59.6%
Taylor expanded in z around 0 38.6%
if 1.4e27 < y Initial program 99.9%
flip--27.0%
clear-num27.0%
associate-+l-27.0%
pow227.0%
Applied egg-rr27.0%
Taylor expanded in x around inf 99.9%
Taylor expanded in y around inf 66.4%
mul-1-neg66.4%
Simplified66.4%
Final simplification52.2%
(FPCore (x y z t) :precision binary64 (if (<= y 1.3e+27) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.3e+27) {
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.3d+27) 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.3e+27) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.3e+27: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.3e+27) 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.3e+27) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.3e+27], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.3 \cdot 10^{+27}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.30000000000000004e27Initial program 99.7%
Taylor expanded in z around inf 33.9%
neg-mul-133.9%
Simplified33.9%
if 1.30000000000000004e27 < y Initial program 99.9%
flip--27.0%
clear-num27.0%
associate-+l-27.0%
pow227.0%
Applied egg-rr27.0%
Taylor expanded in x around inf 99.9%
Taylor expanded in y around inf 66.4%
mul-1-neg66.4%
Simplified66.4%
Final simplification48.3%
(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%
flip--42.9%
clear-num42.9%
associate-+l-42.9%
pow242.9%
Applied egg-rr42.9%
Taylor expanded in x around inf 99.8%
Taylor expanded in y around inf 31.2%
mul-1-neg31.2%
Simplified31.2%
Final simplification31.2%
herbie shell --seed 2023195
(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)))