
(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 12 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%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (or (<= t_2 -5e+15) (not (<= t_2 2e-13)))
(- t_1 (+ y z))
(- (log t) (+ y 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+15) || !(t_2 <= 2e-13)) {
tmp = t_1 - (y + z);
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if ((t_2 <= (-5d+15)) .or. (.not. (t_2 <= 2d-13))) then
tmp = t_1 - (y + z)
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 t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if ((t_2 <= -5e+15) || !(t_2 <= 2e-13)) {
tmp = t_1 - (y + z);
} else {
tmp = Math.log(t) - (y + 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+15) or not (t_2 <= 2e-13): tmp = t_1 - (y + z) else: tmp = math.log(t) - (y + 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+15) || !(t_2 <= 2e-13)) tmp = Float64(t_1 - Float64(y + z)); else tmp = Float64(log(t) - Float64(y + 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+15) || ~((t_2 <= 2e-13))) tmp = t_1 - (y + z); else tmp = log(t) - (y + 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[Or[LessEqual[t$95$2, -5e+15], N[Not[LessEqual[t$95$2, 2e-13]], $MachinePrecision]], N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $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^{+15} \lor \neg \left(t\_2 \leq 2 \cdot 10^{-13}\right):\\
\;\;\;\;t\_1 - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5e15 or 2.0000000000000001e-13 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
if -5e15 < (-.f64 (*.f64 x (log.f64 y)) y) < 2.0000000000000001e-13Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 99.9%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 96.0) (- (+ t_1 (log t)) 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 <= 96.0) {
tmp = (t_1 + log(t)) - 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 <= 96.0d0) then
tmp = (t_1 + log(t)) - 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 <= 96.0) {
tmp = (t_1 + Math.log(t)) - 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 <= 96.0: tmp = (t_1 + math.log(t)) - 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 <= 96.0) tmp = Float64(Float64(t_1 + log(t)) - z); else tmp = Float64(t_1 - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 96.0) tmp = (t_1 + log(t)) - 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, 96.0], N[(N[(t$95$1 + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 96:\\
\;\;\;\;\left(t\_1 + \log t\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \left(y + z\right)\\
\end{array}
\end{array}
if y < 96Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around 0 99.4%
if 96 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 98.8%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -340000000000.0)
t_1
(if (<= x -3.3e-111)
(- z)
(if (<= x -1.9e-199)
(log t)
(if (<= x -2.15e-228)
(- z)
(if (<= x -7.6e-267)
(- y)
(if (<= x 3.2e+54) (- z) (if (<= x 4.6e+87) (- y) t_1)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -340000000000.0) {
tmp = t_1;
} else if (x <= -3.3e-111) {
tmp = -z;
} else if (x <= -1.9e-199) {
tmp = log(t);
} else if (x <= -2.15e-228) {
tmp = -z;
} else if (x <= -7.6e-267) {
tmp = -y;
} else if (x <= 3.2e+54) {
tmp = -z;
} else if (x <= 4.6e+87) {
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 <= (-340000000000.0d0)) then
tmp = t_1
else if (x <= (-3.3d-111)) then
tmp = -z
else if (x <= (-1.9d-199)) then
tmp = log(t)
else if (x <= (-2.15d-228)) then
tmp = -z
else if (x <= (-7.6d-267)) then
tmp = -y
else if (x <= 3.2d+54) then
tmp = -z
else if (x <= 4.6d+87) 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 <= -340000000000.0) {
tmp = t_1;
} else if (x <= -3.3e-111) {
tmp = -z;
} else if (x <= -1.9e-199) {
tmp = Math.log(t);
} else if (x <= -2.15e-228) {
tmp = -z;
} else if (x <= -7.6e-267) {
tmp = -y;
} else if (x <= 3.2e+54) {
tmp = -z;
} else if (x <= 4.6e+87) {
tmp = -y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -340000000000.0: tmp = t_1 elif x <= -3.3e-111: tmp = -z elif x <= -1.9e-199: tmp = math.log(t) elif x <= -2.15e-228: tmp = -z elif x <= -7.6e-267: tmp = -y elif x <= 3.2e+54: tmp = -z elif x <= 4.6e+87: 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 <= -340000000000.0) tmp = t_1; elseif (x <= -3.3e-111) tmp = Float64(-z); elseif (x <= -1.9e-199) tmp = log(t); elseif (x <= -2.15e-228) tmp = Float64(-z); elseif (x <= -7.6e-267) tmp = Float64(-y); elseif (x <= 3.2e+54) tmp = Float64(-z); elseif (x <= 4.6e+87) 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 <= -340000000000.0) tmp = t_1; elseif (x <= -3.3e-111) tmp = -z; elseif (x <= -1.9e-199) tmp = log(t); elseif (x <= -2.15e-228) tmp = -z; elseif (x <= -7.6e-267) tmp = -y; elseif (x <= 3.2e+54) tmp = -z; elseif (x <= 4.6e+87) 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, -340000000000.0], t$95$1, If[LessEqual[x, -3.3e-111], (-z), If[LessEqual[x, -1.9e-199], N[Log[t], $MachinePrecision], If[LessEqual[x, -2.15e-228], (-z), If[LessEqual[x, -7.6e-267], (-y), If[LessEqual[x, 3.2e+54], (-z), If[LessEqual[x, 4.6e+87], (-y), t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -340000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-111}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-199}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{-228}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq -7.6 \cdot 10^{-267}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+54}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+87}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.4e11 or 4.6000000000000003e87 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 65.6%
associate--l+65.6%
+-commutative65.6%
Simplified65.5%
Taylor expanded in x around inf 69.2%
if -3.4e11 < x < -3.3e-111 or -1.8999999999999999e-199 < x < -2.15e-228 or -7.60000000000000006e-267 < x < 3.2e54Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 48.8%
mul-1-neg48.8%
Simplified48.8%
if -3.3e-111 < x < -1.8999999999999999e-199Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in y around 0 81.7%
Taylor expanded in z around 0 63.7%
if -2.15e-228 < x < -7.60000000000000006e-267 or 3.2e54 < x < 4.6000000000000003e87Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in y around inf 60.8%
mul-1-neg60.8%
Simplified60.8%
(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 -2400000000000.0)
t_2
(if (<= x -3.9e-231)
t_3
(if (<= x -1.05e-266)
t_1
(if (<= x 3.7e+55) t_3 (if (<= x 4.8e+86) 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 <= -2400000000000.0) {
tmp = t_2;
} else if (x <= -3.9e-231) {
tmp = t_3;
} else if (x <= -1.05e-266) {
tmp = t_1;
} else if (x <= 3.7e+55) {
tmp = t_3;
} else if (x <= 4.8e+86) {
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 <= (-2400000000000.0d0)) then
tmp = t_2
else if (x <= (-3.9d-231)) then
tmp = t_3
else if (x <= (-1.05d-266)) then
tmp = t_1
else if (x <= 3.7d+55) then
tmp = t_3
else if (x <= 4.8d+86) 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 <= -2400000000000.0) {
tmp = t_2;
} else if (x <= -3.9e-231) {
tmp = t_3;
} else if (x <= -1.05e-266) {
tmp = t_1;
} else if (x <= 3.7e+55) {
tmp = t_3;
} else if (x <= 4.8e+86) {
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 <= -2400000000000.0: tmp = t_2 elif x <= -3.9e-231: tmp = t_3 elif x <= -1.05e-266: tmp = t_1 elif x <= 3.7e+55: tmp = t_3 elif x <= 4.8e+86: 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 <= -2400000000000.0) tmp = t_2; elseif (x <= -3.9e-231) tmp = t_3; elseif (x <= -1.05e-266) tmp = t_1; elseif (x <= 3.7e+55) tmp = t_3; elseif (x <= 4.8e+86) 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 <= -2400000000000.0) tmp = t_2; elseif (x <= -3.9e-231) tmp = t_3; elseif (x <= -1.05e-266) tmp = t_1; elseif (x <= 3.7e+55) tmp = t_3; elseif (x <= 4.8e+86) 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, -2400000000000.0], t$95$2, If[LessEqual[x, -3.9e-231], t$95$3, If[LessEqual[x, -1.05e-266], t$95$1, If[LessEqual[x, 3.7e+55], t$95$3, If[LessEqual[x, 4.8e+86], 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 -2400000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3.9 \cdot 10^{-231}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+55}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.4e12 or 4.8000000000000001e86 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 65.6%
associate--l+65.6%
+-commutative65.6%
Simplified65.5%
Taylor expanded in x around inf 69.2%
if -2.4e12 < x < -3.8999999999999998e-231 or -1.04999999999999998e-266 < x < 3.7000000000000002e55Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 96.5%
Taylor expanded in y around 0 69.8%
if -3.8999999999999998e-231 < x < -1.04999999999999998e-266 or 3.7000000000000002e55 < x < 4.8000000000000001e86Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 96.1%
Taylor expanded in z around 0 77.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (log t) y)))
(if (<= x -1.15e+63)
t_1
(if (<= x -6.8e-43)
t_2
(if (<= x -3.6e-116) (- z) (if (<= x 1.5e+88) 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 <= -1.15e+63) {
tmp = t_1;
} else if (x <= -6.8e-43) {
tmp = t_2;
} else if (x <= -3.6e-116) {
tmp = -z;
} else if (x <= 1.5e+88) {
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 <= (-1.15d+63)) then
tmp = t_1
else if (x <= (-6.8d-43)) then
tmp = t_2
else if (x <= (-3.6d-116)) then
tmp = -z
else if (x <= 1.5d+88) 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 <= -1.15e+63) {
tmp = t_1;
} else if (x <= -6.8e-43) {
tmp = t_2;
} else if (x <= -3.6e-116) {
tmp = -z;
} else if (x <= 1.5e+88) {
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 <= -1.15e+63: tmp = t_1 elif x <= -6.8e-43: tmp = t_2 elif x <= -3.6e-116: tmp = -z elif x <= 1.5e+88: 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 <= -1.15e+63) tmp = t_1; elseif (x <= -6.8e-43) tmp = t_2; elseif (x <= -3.6e-116) tmp = Float64(-z); elseif (x <= 1.5e+88) 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 <= -1.15e+63) tmp = t_1; elseif (x <= -6.8e-43) tmp = t_2; elseif (x <= -3.6e-116) tmp = -z; elseif (x <= 1.5e+88) 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, -1.15e+63], t$95$1, If[LessEqual[x, -6.8e-43], t$95$2, If[LessEqual[x, -3.6e-116], (-z), If[LessEqual[x, 1.5e+88], 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 -1.15 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-43}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{-116}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+88}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.14999999999999997e63 or 1.50000000000000003e88 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 63.7%
associate--l+63.7%
+-commutative63.7%
Simplified63.7%
Taylor expanded in x around inf 73.7%
if -1.14999999999999997e63 < x < -6.8000000000000001e-43 or -3.59999999999999975e-116 < x < 1.50000000000000003e88Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 92.8%
Taylor expanded in z around 0 59.9%
if -6.8000000000000001e-43 < x < -3.59999999999999975e-116Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in z around inf 69.7%
mul-1-neg69.7%
Simplified69.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.5e+26) (not (<= x 7.5e+85))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.5e+26) || !(x <= 7.5e+85)) {
tmp = (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 <= (-3.5d+26)) .or. (.not. (x <= 7.5d+85))) then
tmp = (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 <= -3.5e+26) || !(x <= 7.5e+85)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.5e+26) or not (x <= 7.5e+85): tmp = (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 <= -3.5e+26) || !(x <= 7.5e+85)) tmp = Float64(Float64(x * log(y)) - 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 <= -3.5e+26) || ~((x <= 7.5e+85))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.5e+26], N[Not[LessEqual[x, 7.5e+85]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+26} \lor \neg \left(x \leq 7.5 \cdot 10^{+85}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -3.4999999999999999e26 or 7.49999999999999942e85 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 88.5%
if -3.4999999999999999e26 < x < 7.49999999999999942e85Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 96.4%
Final simplification92.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.35e+63) (not (<= x 1.15e+158))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.35e+63) || !(x <= 1.15e+158)) {
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 <= (-1.35d+63)) .or. (.not. (x <= 1.15d+158))) 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 <= -1.35e+63) || !(x <= 1.15e+158)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.35e+63) or not (x <= 1.15e+158): 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 <= -1.35e+63) || !(x <= 1.15e+158)) 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 <= -1.35e+63) || ~((x <= 1.15e+158))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.35e+63], N[Not[LessEqual[x, 1.15e+158]], $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 -1.35 \cdot 10^{+63} \lor \neg \left(x \leq 1.15 \cdot 10^{+158}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.35000000000000009e63 or 1.14999999999999993e158 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 64.2%
associate--l+64.2%
+-commutative64.2%
Simplified64.1%
Taylor expanded in x around inf 77.7%
if -1.35000000000000009e63 < x < 1.14999999999999993e158Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 90.9%
Final simplification86.1%
(FPCore (x y z t) :precision binary64 (if (<= y 1.25e-99) (- z) (if (<= y 1.35e-69) (log t) (if (<= y 1.18e+42) (- z) (- y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.25e-99) {
tmp = -z;
} else if (y <= 1.35e-69) {
tmp = log(t);
} else if (y <= 1.18e+42) {
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.25d-99) then
tmp = -z
else if (y <= 1.35d-69) then
tmp = log(t)
else if (y <= 1.18d+42) 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.25e-99) {
tmp = -z;
} else if (y <= 1.35e-69) {
tmp = Math.log(t);
} else if (y <= 1.18e+42) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.25e-99: tmp = -z elif y <= 1.35e-69: tmp = math.log(t) elif y <= 1.18e+42: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.25e-99) tmp = Float64(-z); elseif (y <= 1.35e-69) tmp = log(t); elseif (y <= 1.18e+42) 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.25e-99) tmp = -z; elseif (y <= 1.35e-69) tmp = log(t); elseif (y <= 1.18e+42) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.25e-99], (-z), If[LessEqual[y, 1.35e-69], N[Log[t], $MachinePrecision], If[LessEqual[y, 1.18e+42], (-z), (-y)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{-99}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-69}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;y \leq 1.18 \cdot 10^{+42}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.24999999999999992e-99 or 1.3499999999999999e-69 < y < 1.18e42Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 40.7%
mul-1-neg40.7%
Simplified40.7%
if 1.24999999999999992e-99 < y < 1.3499999999999999e-69Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 62.4%
Taylor expanded in y around 0 62.4%
Taylor expanded in z around 0 54.7%
if 1.18e42 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 64.1%
mul-1-neg64.1%
Simplified64.1%
(FPCore (x y z t) :precision binary64 (if (<= y 2.45e+42) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.45e+42) {
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 <= 2.45d+42) 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 <= 2.45e+42) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.45e+42: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.45e+42) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.45e+42) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.45e+42], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45 \cdot 10^{+42}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.4500000000000001e42Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 38.2%
mul-1-neg38.2%
Simplified38.2%
if 2.4500000000000001e42 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 64.1%
mul-1-neg64.1%
Simplified64.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%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 27.8%
mul-1-neg27.8%
Simplified27.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 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%
Simplified99.9%
Taylor expanded in x around inf 84.5%
Taylor expanded in y around inf 21.6%
associate-*r/21.6%
mul-1-neg21.6%
Simplified21.6%
clear-num21.5%
un-div-inv21.7%
add-sqr-sqrt0.0%
sqrt-unprod2.2%
sqr-neg2.2%
sqrt-unprod2.3%
add-sqr-sqrt2.3%
Applied egg-rr2.3%
associate-/r/2.3%
*-inverses2.3%
*-lft-identity2.3%
Simplified2.3%
herbie shell --seed 2024101
(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)))