
(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 (- (fma x (log y) (log t)) (+ y z)))
double code(double x, double y, double z, double t) {
return fma(x, log(y), log(t)) - (y + z);
}
function code(x, y, z, t) return Float64(fma(x, log(y), log(t)) - Float64(y + z)) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t\right) - \left(y + z\right)
\end{array}
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f6499.8
Applied rewrites99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -5e+223)
(- y)
(if (<= t_2 -2e+14)
(fma z (/ (- y) z) (- z))
(if (<= t_2 2e-9) (- (log t) z) t_1)))))
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+223) {
tmp = -y;
} else if (t_2 <= -2e+14) {
tmp = fma(z, (-y / z), -z);
} else if (t_2 <= 2e-9) {
tmp = log(t) - z;
} else {
tmp = t_1;
}
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+223) tmp = Float64(-y); elseif (t_2 <= -2e+14) tmp = fma(z, Float64(Float64(-y) / z), Float64(-z)); elseif (t_2 <= 2e-9) tmp = Float64(log(t) - z); else tmp = t_1; end return 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, -5e+223], (-y), If[LessEqual[t$95$2, -2e+14], N[(z * N[((-y) / z), $MachinePrecision] + (-z)), $MachinePrecision], If[LessEqual[t$95$2, 2e-9], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]]
\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^{+223}:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+14}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{-y}{z}, -z\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -4.99999999999999985e223Initial program 99.7%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6460.4
Applied rewrites60.4%
if -4.99999999999999985e223 < (-.f64 (*.f64 x (log.f64 y)) y) < -2e14Initial program 100.0%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64100.0
Applied rewrites100.0%
Taylor expanded in z around -inf
associate-*r*N/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
distribute-lft-neg-inN/A
mul-1-negN/A
distribute-rgt-neg-outN/A
remove-double-negN/A
lower-fma.f64N/A
Applied rewrites86.0%
Taylor expanded in y around inf
Applied rewrites69.1%
if -2e14 < (-.f64 (*.f64 x (log.f64 y)) y) < 2.00000000000000012e-9Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6498.4
Applied rewrites98.4%
Taylor expanded in y around 0
Applied rewrites96.6%
if 2.00000000000000012e-9 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6484.6
Applied rewrites84.6%
(FPCore (x y z t) :precision binary64 (if (<= y 150.0) (fma x (log y) (- (log t) z)) (- (* x (log y)) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 150.0) {
tmp = fma(x, log(y), (log(t) - z));
} else {
tmp = (x * log(y)) - (y + z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 150.0) tmp = fma(x, log(y), Float64(log(t) - z)); else tmp = Float64(Float64(x * log(y)) - Float64(y + z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 150.0], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 150:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - \left(y + z\right)\\
\end{array}
\end{array}
if y < 150Initial program 99.8%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f6498.7
Applied rewrites98.7%
if 150 < y Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6499.7
Applied rewrites99.7%
(FPCore (x y z t) :precision binary64 (if (<= x -5.6e+45) (- (* x (log y)) (+ y z)) (if (<= x 7.4) (- (log t) (+ y z)) (fma (log y) x (- (- z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.6e+45) {
tmp = (x * log(y)) - (y + z);
} else if (x <= 7.4) {
tmp = log(t) - (y + z);
} else {
tmp = fma(log(y), x, (-z - y));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -5.6e+45) tmp = Float64(Float64(x * log(y)) - Float64(y + z)); elseif (x <= 7.4) tmp = Float64(log(t) - Float64(y + z)); else tmp = fma(log(y), x, Float64(Float64(-z) - y)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.6e+45], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.4], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + N[((-z) - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{+45}:\\
\;\;\;\;x \cdot \log y - \left(y + z\right)\\
\mathbf{elif}\;x \leq 7.4:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \left(-z\right) - y\right)\\
\end{array}
\end{array}
if x < -5.5999999999999999e45Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f6499.6
Applied rewrites99.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6499.6
Applied rewrites99.6%
if -5.5999999999999999e45 < x < 7.4000000000000004Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6499.2
Applied rewrites99.2%
if 7.4000000000000004 < x Initial program 99.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-negN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
associate--r-N/A
lower-+.f64N/A
lower--.f64N/A
lower-neg.f6499.8
Applied rewrites99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-neg.f64N/A
sub-negN/A
associate--r+N/A
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6499.5
Applied rewrites99.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* x (log y)) (+ y z)))) (if (<= x -5.6e+45) t_1 (if (<= x 7.4) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - (y + z);
double tmp;
if (x <= -5.6e+45) {
tmp = t_1;
} else if (x <= 7.4) {
tmp = log(t) - (y + z);
} 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)) - (y + z)
if (x <= (-5.6d+45)) then
tmp = t_1
else if (x <= 7.4d0) then
tmp = log(t) - (y + z)
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)) - (y + z);
double tmp;
if (x <= -5.6e+45) {
tmp = t_1;
} else if (x <= 7.4) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - (y + z) tmp = 0 if x <= -5.6e+45: tmp = t_1 elif x <= 7.4: tmp = math.log(t) - (y + z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - Float64(y + z)) tmp = 0.0 if (x <= -5.6e+45) tmp = t_1; elseif (x <= 7.4) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - (y + z); tmp = 0.0; if (x <= -5.6e+45) tmp = t_1; elseif (x <= 7.4) tmp = log(t) - (y + z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.6e+45], t$95$1, If[LessEqual[x, 7.4], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - \left(y + z\right)\\
\mathbf{if}\;x \leq -5.6 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.4:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.5999999999999999e45 or 7.4000000000000004 < x Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f6499.7
Applied rewrites99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6499.5
Applied rewrites99.5%
if -5.5999999999999999e45 < x < 7.4000000000000004Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6499.2
Applied rewrites99.2%
(FPCore (x y z t) :precision binary64 (if (<= x -4.2e+121) (fma (log y) x (- y)) (if (<= x 1350.0) (- (log t) (+ y z)) (fma (log y) x (- z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.2e+121) {
tmp = fma(log(y), x, -y);
} else if (x <= 1350.0) {
tmp = log(t) - (y + z);
} else {
tmp = fma(log(y), x, -z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -4.2e+121) tmp = fma(log(y), x, Float64(-y)); elseif (x <= 1350.0) tmp = Float64(log(t) - Float64(y + z)); else tmp = fma(log(y), x, Float64(-z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.2e+121], N[(N[Log[y], $MachinePrecision] * x + (-y)), $MachinePrecision], If[LessEqual[x, 1350.0], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -y\right)\\
\mathbf{elif}\;x \leq 1350:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -z\right)\\
\end{array}
\end{array}
if x < -4.2000000000000003e121Initial program 99.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-negN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
associate--r-N/A
lower-+.f64N/A
lower--.f64N/A
lower-neg.f6499.4
Applied rewrites99.4%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6493.8
Applied rewrites93.8%
if -4.2000000000000003e121 < x < 1350Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6495.9
Applied rewrites95.9%
if 1350 < x Initial program 99.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-negN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
associate--r-N/A
lower-+.f64N/A
lower--.f64N/A
lower-neg.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6485.1
Applied rewrites85.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma (log y) x (- y)))) (if (<= x -4.2e+121) t_1 (if (<= x 8.8e+18) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(log(y), x, -y);
double tmp;
if (x <= -4.2e+121) {
tmp = t_1;
} else if (x <= 8.8e+18) {
tmp = log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(log(y), x, Float64(-y)) tmp = 0.0 if (x <= -4.2e+121) tmp = t_1; elseif (x <= 8.8e+18) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x + (-y)), $MachinePrecision]}, If[LessEqual[x, -4.2e+121], t$95$1, If[LessEqual[x, 8.8e+18], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\log y, x, -y\right)\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{+18}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.2000000000000003e121 or 8.8e18 < x Initial program 99.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-negN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
associate--r-N/A
lower-+.f64N/A
lower--.f64N/A
lower-neg.f6499.7
Applied rewrites99.7%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6487.7
Applied rewrites87.7%
if -4.2000000000000003e121 < x < 8.8e18Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6496.0
Applied rewrites96.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= x -4.5e+121) t_1 (if (<= x 5.5e+83) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -4.5e+121) {
tmp = t_1;
} else if (x <= 5.5e+83) {
tmp = log(t) - (y + z);
} 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 <= (-4.5d+121)) then
tmp = t_1
else if (x <= 5.5d+83) then
tmp = log(t) - (y + z)
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 <= -4.5e+121) {
tmp = t_1;
} else if (x <= 5.5e+83) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -4.5e+121: tmp = t_1 elif x <= 5.5e+83: tmp = math.log(t) - (y + z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -4.5e+121) tmp = t_1; elseif (x <= 5.5e+83) tmp = Float64(log(t) - Float64(y + z)); 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 <= -4.5e+121) tmp = t_1; elseif (x <= 5.5e+83) tmp = log(t) - (y + z); 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, -4.5e+121], t$95$1, If[LessEqual[x, 5.5e+83], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+83}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.5000000000000003e121 or 5.4999999999999996e83 < x Initial program 99.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6475.3
Applied rewrites75.3%
if -4.5000000000000003e121 < x < 5.4999999999999996e83Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6494.4
Applied rewrites94.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma z (/ (- y) z) (- z)))) (if (<= z -6650.0) t_1 (if (<= z 330.0) (- (log t) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(z, (-y / z), -z);
double tmp;
if (z <= -6650.0) {
tmp = t_1;
} else if (z <= 330.0) {
tmp = log(t) - y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(z, Float64(Float64(-y) / z), Float64(-z)) tmp = 0.0 if (z <= -6650.0) tmp = t_1; elseif (z <= 330.0) tmp = Float64(log(t) - y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[((-y) / z), $MachinePrecision] + (-z)), $MachinePrecision]}, If[LessEqual[z, -6650.0], t$95$1, If[LessEqual[z, 330.0], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{-y}{z}, -z\right)\\
\mathbf{if}\;z \leq -6650:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 330:\\
\;\;\;\;\log t - y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6650 or 330 < z Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in z around -inf
associate-*r*N/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
distribute-lft-neg-inN/A
mul-1-negN/A
distribute-rgt-neg-outN/A
remove-double-negN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in y around inf
Applied rewrites72.3%
if -6650 < z < 330Initial program 99.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6467.5
Applied rewrites67.5%
Taylor expanded in z around 0
Applied rewrites67.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma z (/ (- y) z) (- z)))) (if (<= z -6650.0) t_1 (if (<= z 120000000.0) (- y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(z, (-y / z), -z);
double tmp;
if (z <= -6650.0) {
tmp = t_1;
} else if (z <= 120000000.0) {
tmp = -y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(z, Float64(Float64(-y) / z), Float64(-z)) tmp = 0.0 if (z <= -6650.0) tmp = t_1; elseif (z <= 120000000.0) tmp = Float64(-y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[((-y) / z), $MachinePrecision] + (-z)), $MachinePrecision]}, If[LessEqual[z, -6650.0], t$95$1, If[LessEqual[z, 120000000.0], (-y), t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{-y}{z}, -z\right)\\
\mathbf{if}\;z \leq -6650:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 120000000:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6650 or 1.2e8 < z Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+r-N/A
lower--.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in z around -inf
associate-*r*N/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
distribute-lft-neg-inN/A
mul-1-negN/A
distribute-rgt-neg-outN/A
remove-double-negN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in y around inf
Applied rewrites72.8%
if -6650 < z < 1.2e8Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6441.9
Applied rewrites41.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1.3e+130) (- z) (if (<= z 4.8e+93) (- y) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e+130) {
tmp = -z;
} else if (z <= 4.8e+93) {
tmp = -y;
} else {
tmp = -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 (z <= (-1.3d+130)) then
tmp = -z
else if (z <= 4.8d+93) then
tmp = -y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e+130) {
tmp = -z;
} else if (z <= 4.8e+93) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.3e+130: tmp = -z elif z <= 4.8e+93: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.3e+130) tmp = Float64(-z); elseif (z <= 4.8e+93) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.3e+130) tmp = -z; elseif (z <= 4.8e+93) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.3e+130], (-z), If[LessEqual[z, 4.8e+93], (-y), (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+130}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+93}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1.2999999999999999e130 or 4.80000000000000021e93 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6476.6
Applied rewrites76.6%
if -1.2999999999999999e130 < z < 4.80000000000000021e93Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6441.2
Applied rewrites41.2%
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
return -y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -y
end function
public static double code(double x, double y, double z, double t) {
return -y;
}
def code(x, y, z, t): return -y
function code(x, y, z, t) return Float64(-y) end
function tmp = code(x, y, z, t) tmp = -y; end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6429.5
Applied rewrites29.5%
herbie shell --seed 2024220
(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)))