
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (- (fma x (log y) (- (log t) z)) y))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (log(t) - z)) - y;
}
function code(x, y, z, t) return Float64(fma(x, log(y), Float64(log(t) - z)) - y) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
\end{array}
Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (or (<= t_1 -4e+35) (not (<= t_1 5e-10)))
(- t_1 z)
(- (- (log t) z) y))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if ((t_1 <= -4e+35) || !(t_1 <= 5e-10)) {
tmp = t_1 - z;
} else {
tmp = (log(t) - z) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - y
if ((t_1 <= (-4d+35)) .or. (.not. (t_1 <= 5d-10))) then
tmp = t_1 - z
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * Math.log(y)) - y;
double tmp;
if ((t_1 <= -4e+35) || !(t_1 <= 5e-10)) {
tmp = t_1 - z;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if (t_1 <= -4e+35) or not (t_1 <= 5e-10): tmp = t_1 - z else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if ((t_1 <= -4e+35) || !(t_1 <= 5e-10)) tmp = Float64(t_1 - z); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; tmp = 0.0; if ((t_1 <= -4e+35) || ~((t_1 <= 5e-10))) tmp = t_1 - z; else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+35], N[Not[LessEqual[t$95$1, 5e-10]], $MachinePrecision]], N[(t$95$1 - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+35} \lor \neg \left(t_1 \leq 5 \cdot 10^{-10}\right):\\
\;\;\;\;t_1 - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -3.9999999999999999e35 or 5.00000000000000031e-10 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
if -3.9999999999999999e35 < (-.f64 (*.f64 x (log.f64 y)) y) < 5.00000000000000031e-10Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.7%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y))) (if (<= t_2 -5000.0) (- t_2 z) (- (+ (log t) t_1) z))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -5000.0) {
tmp = t_2 - z;
} else {
tmp = (log(t) + t_1) - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-5000.0d0)) then
tmp = t_2 - z
else
tmp = (log(t) + t_1) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -5000.0) {
tmp = t_2 - z;
} else {
tmp = (Math.log(t) + t_1) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -5000.0: tmp = t_2 - z else: tmp = (math.log(t) + t_1) - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -5000.0) tmp = Float64(t_2 - z); else tmp = Float64(Float64(log(t) + t_1) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -5000.0) tmp = t_2 - z; else tmp = (log(t) + t_1) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5000.0], N[(t$95$2 - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t_1 - y\\
\mathbf{if}\;t_2 \leq -5000:\\
\;\;\;\;t_2 - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t + t_1\right) - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5e3Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 98.8%
if -5e3 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((x * log(y)) - y) - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = log(t) + (((x * log(y)) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((x * Math.log(y)) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((x * math.log(y)) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(x * log(y)) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((x * log(y)) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(x \cdot \log y - y\right) - z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (- y) z)))
(if (<= x -5.05e+123)
t_1
(if (<= x -1.55e-55)
t_2
(if (<= x -3.8e-82) (log t) (if (<= x 5e+119) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = -y - z;
double tmp;
if (x <= -5.05e+123) {
tmp = t_1;
} else if (x <= -1.55e-55) {
tmp = t_2;
} else if (x <= -3.8e-82) {
tmp = log(t);
} else if (x <= 5e+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 = -y - z
if (x <= (-5.05d+123)) then
tmp = t_1
else if (x <= (-1.55d-55)) then
tmp = t_2
else if (x <= (-3.8d-82)) then
tmp = log(t)
else if (x <= 5d+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 = -y - z;
double tmp;
if (x <= -5.05e+123) {
tmp = t_1;
} else if (x <= -1.55e-55) {
tmp = t_2;
} else if (x <= -3.8e-82) {
tmp = Math.log(t);
} else if (x <= 5e+119) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = -y - z tmp = 0 if x <= -5.05e+123: tmp = t_1 elif x <= -1.55e-55: tmp = t_2 elif x <= -3.8e-82: tmp = math.log(t) elif x <= 5e+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(-y) - z) tmp = 0.0 if (x <= -5.05e+123) tmp = t_1; elseif (x <= -1.55e-55) tmp = t_2; elseif (x <= -3.8e-82) tmp = log(t); elseif (x <= 5e+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 = -y - z; tmp = 0.0; if (x <= -5.05e+123) tmp = t_1; elseif (x <= -1.55e-55) tmp = t_2; elseif (x <= -3.8e-82) tmp = log(t); elseif (x <= 5e+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[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -5.05e+123], t$95$1, If[LessEqual[x, -1.55e-55], t$95$2, If[LessEqual[x, -3.8e-82], N[Log[t], $MachinePrecision], If[LessEqual[x, 5e+119], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -5.05 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-55}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-82}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+119}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -5.0499999999999997e123 or 4.9999999999999999e119 < x Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around 0 85.5%
Taylor expanded in z around 0 70.8%
Taylor expanded in x around inf 70.8%
if -5.0499999999999997e123 < x < -1.54999999999999998e-55 or -3.8000000000000002e-82 < x < 4.9999999999999999e119Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 81.4%
Taylor expanded in x around 0 72.2%
neg-mul-172.2%
Simplified72.2%
if -1.54999999999999998e-55 < x < -3.8000000000000002e-82Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
unsub-neg99.7%
fma-udef99.7%
neg-sub099.7%
associate-+l-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in y around 0 83.3%
Taylor expanded in z around 0 76.6%
Final simplification71.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) z)))
(if (<= y 1.45e-81)
t_1
(if (<= y 2.7e-37) (- (log t) z) (if (<= y 2.05e+55) t_1 (- (- y) z))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - z;
double tmp;
if (y <= 1.45e-81) {
tmp = t_1;
} else if (y <= 2.7e-37) {
tmp = log(t) - z;
} else if (y <= 2.05e+55) {
tmp = t_1;
} else {
tmp = -y - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - z
if (y <= 1.45d-81) then
tmp = t_1
else if (y <= 2.7d-37) then
tmp = log(t) - z
else if (y <= 2.05d+55) then
tmp = t_1
else
tmp = -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)) - z;
double tmp;
if (y <= 1.45e-81) {
tmp = t_1;
} else if (y <= 2.7e-37) {
tmp = Math.log(t) - z;
} else if (y <= 2.05e+55) {
tmp = t_1;
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - z tmp = 0 if y <= 1.45e-81: tmp = t_1 elif y <= 2.7e-37: tmp = math.log(t) - z elif y <= 2.05e+55: tmp = t_1 else: tmp = -y - z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - z) tmp = 0.0 if (y <= 1.45e-81) tmp = t_1; elseif (y <= 2.7e-37) tmp = Float64(log(t) - z); elseif (y <= 2.05e+55) tmp = t_1; else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - z; tmp = 0.0; if (y <= 1.45e-81) tmp = t_1; elseif (y <= 2.7e-37) tmp = log(t) - z; elseif (y <= 2.05e+55) tmp = t_1; else tmp = -y - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[y, 1.45e-81], t$95$1, If[LessEqual[y, 2.7e-37], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 2.05e+55], t$95$1, N[((-y) - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - z\\
\mathbf{if}\;y \leq 1.45 \cdot 10^{-81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-37}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if y < 1.44999999999999994e-81 or 2.70000000000000016e-37 < y < 2.04999999999999991e55Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 78.6%
Taylor expanded in x around inf 72.5%
if 1.44999999999999994e-81 < y < 2.70000000000000016e-37Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
unsub-neg99.8%
fma-udef99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 79.6%
Taylor expanded in y around 0 79.6%
if 2.04999999999999991e55 < y Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Taylor expanded in x around 0 88.9%
neg-mul-188.9%
Simplified88.9%
Final simplification80.0%
(FPCore (x y z t) :precision binary64 (if (<= y 1.7e-167) (log t) (if (<= y 7.2e-87) (- z) (if (<= y 5.5e-27) (log t) (- (- y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.7e-167) {
tmp = log(t);
} else if (y <= 7.2e-87) {
tmp = -z;
} else if (y <= 5.5e-27) {
tmp = log(t);
} else {
tmp = -y - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.7d-167) then
tmp = log(t)
else if (y <= 7.2d-87) then
tmp = -z
else if (y <= 5.5d-27) then
tmp = log(t)
else
tmp = -y - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.7e-167) {
tmp = Math.log(t);
} else if (y <= 7.2e-87) {
tmp = -z;
} else if (y <= 5.5e-27) {
tmp = Math.log(t);
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.7e-167: tmp = math.log(t) elif y <= 7.2e-87: tmp = -z elif y <= 5.5e-27: tmp = math.log(t) else: tmp = -y - z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.7e-167) tmp = log(t); elseif (y <= 7.2e-87) tmp = Float64(-z); elseif (y <= 5.5e-27) tmp = log(t); else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.7e-167) tmp = log(t); elseif (y <= 7.2e-87) tmp = -z; elseif (y <= 5.5e-27) tmp = log(t); else tmp = -y - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.7e-167], N[Log[t], $MachinePrecision], If[LessEqual[y, 7.2e-87], (-z), If[LessEqual[y, 5.5e-27], N[Log[t], $MachinePrecision], N[((-y) - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{-167}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-87}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-27}:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if y < 1.6999999999999999e-167 or 7.19999999999999986e-87 < y < 5.5000000000000002e-27Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
unsub-neg99.8%
fma-udef99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 62.3%
Taylor expanded in y around 0 62.3%
Taylor expanded in z around 0 40.0%
if 1.6999999999999999e-167 < y < 7.19999999999999986e-87Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 38.5%
neg-mul-138.5%
Simplified38.5%
if 5.5000000000000002e-27 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 98.1%
Taylor expanded in x around 0 81.3%
neg-mul-181.3%
Simplified81.3%
Final simplification63.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.2e+65) (not (<= x 2.2e+26))) (- (* x (log y)) z) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.2e+65) || !(x <= 2.2e+26)) {
tmp = (x * log(y)) - z;
} else {
tmp = (log(t) - z) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.2d+65)) .or. (.not. (x <= 2.2d+26))) then
tmp = (x * log(y)) - z
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.2e+65) || !(x <= 2.2e+26)) {
tmp = (x * Math.log(y)) - z;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.2e+65) or not (x <= 2.2e+26): tmp = (x * math.log(y)) - z else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.2e+65) || !(x <= 2.2e+26)) tmp = Float64(Float64(x * log(y)) - z); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.2e+65) || ~((x <= 2.2e+26))) tmp = (x * log(y)) - z; else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.2e+65], N[Not[LessEqual[x, 2.2e+26]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+65} \lor \neg \left(x \leq 2.2 \cdot 10^{+26}\right):\\
\;\;\;\;x \cdot \log y - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -1.2000000000000001e65 or 2.20000000000000007e26 < x Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around inf 81.5%
if -1.2000000000000001e65 < x < 2.20000000000000007e26Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 97.8%
Final simplification91.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.6e+21) (not (<= z 3300000.0))) (- (- y) z) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.6e+21) || !(z <= 3300000.0)) {
tmp = -y - z;
} else {
tmp = log(t) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4.6d+21)) .or. (.not. (z <= 3300000.0d0))) then
tmp = -y - z
else
tmp = log(t) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.6e+21) || !(z <= 3300000.0)) {
tmp = -y - z;
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.6e+21) or not (z <= 3300000.0): tmp = -y - z else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.6e+21) || !(z <= 3300000.0)) tmp = Float64(Float64(-y) - z); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.6e+21) || ~((z <= 3300000.0))) tmp = -y - z; else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.6e+21], N[Not[LessEqual[z, 3300000.0]], $MachinePrecision]], N[((-y) - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+21} \lor \neg \left(z \leq 3300000\right):\\
\;\;\;\;\left(-y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if z < -4.6e21 or 3.3e6 < z Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.6%
Taylor expanded in x around 0 78.1%
neg-mul-178.1%
Simplified78.1%
if -4.6e21 < z < 3.3e6Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 69.5%
Taylor expanded in z around 0 68.7%
Final simplification73.1%
(FPCore (x y z t) :precision binary64 (if (<= y 0.00102) (- (log t) z) (- (- y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.00102) {
tmp = log(t) - z;
} else {
tmp = -y - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 0.00102d0) then
tmp = log(t) - z
else
tmp = -y - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.00102) {
tmp = Math.log(t) - z;
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 0.00102: tmp = math.log(t) - z else: tmp = -y - z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 0.00102) tmp = Float64(log(t) - z); else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 0.00102) tmp = log(t) - z; else tmp = -y - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 0.00102], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[((-y) - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.00102:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if y < 0.00102Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
unsub-neg99.8%
fma-udef99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 61.9%
Taylor expanded in y around 0 61.9%
if 0.00102 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 98.7%
Taylor expanded in x around 0 82.5%
neg-mul-182.5%
Simplified82.5%
Final simplification73.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4e+100) (not (<= z 1.05e+106))) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4e+100) || !(z <= 1.05e+106)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4d+100)) .or. (.not. (z <= 1.05d+106))) then
tmp = -z
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4e+100) || !(z <= 1.05e+106)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4e+100) or not (z <= 1.05e+106): tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4e+100) || !(z <= 1.05e+106)) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4e+100) || ~((z <= 1.05e+106))) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4e+100], N[Not[LessEqual[z, 1.05e+106]], $MachinePrecision]], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+100} \lor \neg \left(z \leq 1.05 \cdot 10^{+106}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -4.00000000000000006e100 or 1.05000000000000002e106 < z Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 69.1%
neg-mul-169.1%
Simplified69.1%
if -4.00000000000000006e100 < z < 1.05000000000000002e106Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 69.8%
Taylor expanded in y around inf 43.4%
mul-1-neg43.4%
Simplified43.4%
Final simplification51.9%
(FPCore (x y z t) :precision binary64 (- (- y) z))
double code(double x, double y, double z, double t) {
return -y - z;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -y - z
end function
public static double code(double x, double y, double z, double t) {
return -y - z;
}
def code(x, y, z, t): return -y - z
function code(x, y, z, t) return Float64(Float64(-y) - z) end
function tmp = code(x, y, z, t) tmp = -y - z; end
code[x_, y_, z_, t_] := N[((-y) - z), $MachinePrecision]
\begin{array}{l}
\\
\left(-y\right) - z
\end{array}
Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 84.9%
Taylor expanded in x around 0 58.6%
neg-mul-158.6%
Simplified58.6%
Final simplification58.6%
(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%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 73.6%
Taylor expanded in y around inf 33.9%
mul-1-neg33.9%
Simplified33.9%
Final simplification33.9%
herbie shell --seed 2024021
(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)))