
(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 (log y) x (- (- (log t) y) z)))
double code(double x, double y, double z, double t) {
return fma(log(y), x, ((log(t) - y) - z));
}
function code(x, y, z, t) return fma(log(y), x, Float64(Float64(log(t) - y) - z)) end
code[x_, y_, z_, t_] := N[(N[Log[y], $MachinePrecision] * x + N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log y, x, \left(\log t - y\right) - z\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
remove-double-negN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
cancel-sign-subN/A
mul-1-negN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (log y) x)) (t_2 (- t_1 y))) (if (<= t_2 -2e+28) (- y) (if (<= t_2 5e+113) (- (log t) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+28) {
tmp = -y;
} else if (t_2 <= 5e+113) {
tmp = log(t) - 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) :: t_2
real(8) :: tmp
t_1 = log(y) * x
t_2 = t_1 - y
if (t_2 <= (-2d+28)) then
tmp = -y
else if (t_2 <= 5d+113) then
tmp = log(t) - 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 = Math.log(y) * x;
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+28) {
tmp = -y;
} else if (t_2 <= 5e+113) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x t_2 = t_1 - y tmp = 0 if t_2 <= -2e+28: tmp = -y elif t_2 <= 5e+113: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -2e+28) tmp = Float64(-y); elseif (t_2 <= 5e+113) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -2e+28) tmp = -y; elseif (t_2 <= 5e+113) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+28], (-y), If[LessEqual[t$95$2, 5e+113], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+28}:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+113}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999992e28Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
remove-double-negN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
cancel-sign-subN/A
mul-1-negN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6452.4
Applied rewrites52.4%
if -1.99999999999999992e28 < (-.f64 (*.f64 x (log.f64 y)) y) < 5e113Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
remove-double-negN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
cancel-sign-subN/A
mul-1-negN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites100.0%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6491.4
Applied rewrites91.4%
Taylor expanded in y around 0
Applied rewrites90.2%
if 5e113 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
lift--.f64N/A
flip--N/A
div-subN/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites97.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6487.4
Applied rewrites87.4%
Final simplification71.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) y)))
(if (<= z -4.5e+88)
(- t_1 z)
(if (<= z 3.3e-10) (fma (log y) x t_1) (fma (log y) x (- (log t) z))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double tmp;
if (z <= -4.5e+88) {
tmp = t_1 - z;
} else if (z <= 3.3e-10) {
tmp = fma(log(y), x, t_1);
} else {
tmp = fma(log(y), x, (log(t) - z));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(t) - y) tmp = 0.0 if (z <= -4.5e+88) tmp = Float64(t_1 - z); elseif (z <= 3.3e-10) tmp = fma(log(y), x, t_1); else tmp = fma(log(y), x, Float64(log(t) - z)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[z, -4.5e+88], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[z, 3.3e-10], N[(N[Log[y], $MachinePrecision] * x + t$95$1), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+88}:\\
\;\;\;\;t\_1 - z\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t - z\right)\\
\end{array}
\end{array}
if z < -4.5e88Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6490.2
Applied rewrites90.2%
if -4.5e88 < z < 3.3e-10Initial program 99.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6497.8
Applied rewrites97.8%
Applied rewrites97.8%
if 3.3e-10 < z Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
remove-double-negN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
cancel-sign-subN/A
mul-1-negN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.9%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f64N/A
lower-log.f6488.2
Applied rewrites88.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) y)))
(if (<= z -4.5e+88)
(- t_1 z)
(if (<= z 3.3e-10) (fma (log y) x t_1) (- (fma (log y) x (log t)) z)))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double tmp;
if (z <= -4.5e+88) {
tmp = t_1 - z;
} else if (z <= 3.3e-10) {
tmp = fma(log(y), x, t_1);
} else {
tmp = fma(log(y), x, log(t)) - z;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(t) - y) tmp = 0.0 if (z <= -4.5e+88) tmp = Float64(t_1 - z); elseif (z <= 3.3e-10) tmp = fma(log(y), x, t_1); else tmp = Float64(fma(log(y), x, log(t)) - z); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[z, -4.5e+88], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[z, 3.3e-10], N[(N[Log[y], $MachinePrecision] * x + t$95$1), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+88}:\\
\;\;\;\;t\_1 - z\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - z\\
\end{array}
\end{array}
if z < -4.5e88Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6490.2
Applied rewrites90.2%
if -4.5e88 < z < 3.3e-10Initial program 99.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6497.8
Applied rewrites97.8%
Applied rewrites97.8%
if 3.3e-10 < z Initial program 99.9%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6488.2
Applied rewrites88.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (log y) x (log t))))
(if (<= z -4.5e+88)
(- (- (log t) y) z)
(if (<= z 3.3e-10) (- t_1 y) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = fma(log(y), x, log(t));
double tmp;
if (z <= -4.5e+88) {
tmp = (log(t) - y) - z;
} else if (z <= 3.3e-10) {
tmp = t_1 - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(log(y), x, log(t)) tmp = 0.0 if (z <= -4.5e+88) tmp = Float64(Float64(log(t) - y) - z); elseif (z <= 3.3e-10) tmp = Float64(t_1 - y); else tmp = Float64(t_1 - z); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+88], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[z, 3.3e-10], N[(t$95$1 - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\log y, x, \log t\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+88}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-10}:\\
\;\;\;\;t\_1 - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if z < -4.5e88Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6490.2
Applied rewrites90.2%
if -4.5e88 < z < 3.3e-10Initial program 99.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6497.8
Applied rewrites97.8%
if 3.3e-10 < z Initial program 99.9%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6488.2
Applied rewrites88.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (fma (log y) x (log t)) y))) (if (<= x -4.1e+114) t_1 (if (<= x 7.4e+15) (- (- (log t) y) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(log(y), x, log(t)) - y;
double tmp;
if (x <= -4.1e+114) {
tmp = t_1;
} else if (x <= 7.4e+15) {
tmp = (log(t) - y) - z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(fma(log(y), x, log(t)) - y) tmp = 0.0 if (x <= -4.1e+114) tmp = t_1; elseif (x <= 7.4e+15) tmp = Float64(Float64(log(t) - y) - z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -4.1e+114], t$95$1, If[LessEqual[x, 7.4e+15], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\log y, x, \log t\right) - y\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{+15}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.1000000000000001e114 or 7.4e15 < x Initial program 99.7%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6484.6
Applied rewrites84.6%
if -4.1000000000000001e114 < x < 7.4e15Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6497.8
Applied rewrites97.8%
(FPCore (x y z t) :precision binary64 (if (<= x -6.5e+168) (* (log y) x) (if (<= x 1.75e+109) (- (- (log t) y) z) (fma (log y) x (log t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.5e+168) {
tmp = log(y) * x;
} else if (x <= 1.75e+109) {
tmp = (log(t) - y) - z;
} else {
tmp = fma(log(y), x, log(t));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -6.5e+168) tmp = Float64(log(y) * x); elseif (x <= 1.75e+109) tmp = Float64(Float64(log(t) - y) - z); else tmp = fma(log(y), x, log(t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.5e+168], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 1.75e+109], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+168}:\\
\;\;\;\;\log y \cdot x\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+109}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right)\\
\end{array}
\end{array}
if x < -6.49999999999999999e168Initial program 99.6%
lift--.f64N/A
flip--N/A
div-subN/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites96.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6486.4
Applied rewrites86.4%
if -6.49999999999999999e168 < x < 1.74999999999999992e109Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6490.2
Applied rewrites90.2%
if 1.74999999999999992e109 < x Initial program 99.7%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6488.6
Applied rewrites88.6%
Applied rewrites88.6%
Taylor expanded in y around 0
Applied rewrites76.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (log y) x))) (if (<= x -6.5e+168) t_1 (if (<= x 1.75e+109) (- (- (log t) y) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -6.5e+168) {
tmp = t_1;
} else if (x <= 1.75e+109) {
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 = log(y) * x
if (x <= (-6.5d+168)) then
tmp = t_1
else if (x <= 1.75d+109) 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 = Math.log(y) * x;
double tmp;
if (x <= -6.5e+168) {
tmp = t_1;
} else if (x <= 1.75e+109) {
tmp = (Math.log(t) - y) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -6.5e+168: tmp = t_1 elif x <= 1.75e+109: tmp = (math.log(t) - y) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -6.5e+168) tmp = t_1; elseif (x <= 1.75e+109) tmp = Float64(Float64(log(t) - y) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; tmp = 0.0; if (x <= -6.5e+168) tmp = t_1; elseif (x <= 1.75e+109) 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[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -6.5e+168], t$95$1, If[LessEqual[x, 1.75e+109], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+109}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.49999999999999999e168 or 1.74999999999999992e109 < x Initial program 99.6%
lift--.f64N/A
flip--N/A
div-subN/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites97.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6480.5
Applied rewrites80.5%
if -6.49999999999999999e168 < x < 1.74999999999999992e109Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6490.2
Applied rewrites90.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.35e+90) (- z) (if (<= z 0.0132) (- (log t) y) (- (log t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+90) {
tmp = -z;
} else if (z <= 0.0132) {
tmp = log(t) - y;
} else {
tmp = 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 (z <= (-1.35d+90)) then
tmp = -z
else if (z <= 0.0132d0) then
tmp = log(t) - y
else
tmp = log(t) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+90) {
tmp = -z;
} else if (z <= 0.0132) {
tmp = Math.log(t) - y;
} else {
tmp = Math.log(t) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.35e+90: tmp = -z elif z <= 0.0132: tmp = math.log(t) - y else: tmp = math.log(t) - z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.35e+90) tmp = Float64(-z); elseif (z <= 0.0132) tmp = Float64(log(t) - y); else tmp = Float64(log(t) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.35e+90) tmp = -z; elseif (z <= 0.0132) tmp = log(t) - y; else tmp = log(t) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e+90], (-z), If[LessEqual[z, 0.0132], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+90}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 0.0132:\\
\;\;\;\;\log t - y\\
\mathbf{else}:\\
\;\;\;\;\log t - z\\
\end{array}
\end{array}
if z < -1.35e90Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6476.3
Applied rewrites76.3%
if -1.35e90 < z < 0.0132Initial program 99.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6497.6
Applied rewrites97.6%
Taylor expanded in x around 0
Applied rewrites55.5%
if 0.0132 < z Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
remove-double-negN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
cancel-sign-subN/A
mul-1-negN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6476.8
Applied rewrites76.8%
Taylor expanded in y around 0
Applied rewrites65.3%
(FPCore (x y z t) :precision binary64 (if (<= y 2.8e+28) (- (log t) z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.8e+28) {
tmp = log(t) - 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.8d+28) then
tmp = log(t) - 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.8e+28) {
tmp = Math.log(t) - z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.8e+28: tmp = math.log(t) - z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.8e+28) tmp = Float64(log(t) - z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.8e+28) tmp = log(t) - z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.8e+28], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.8 \cdot 10^{+28}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.8000000000000001e28Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
remove-double-negN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
cancel-sign-subN/A
mul-1-negN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6463.4
Applied rewrites63.4%
Taylor expanded in y around 0
Applied rewrites62.6%
if 2.8000000000000001e28 < y Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
remove-double-negN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
cancel-sign-subN/A
mul-1-negN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6454.0
Applied rewrites54.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.35e+90) (- z) (if (<= z 1150000.0) (- y) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+90) {
tmp = -z;
} else if (z <= 1150000.0) {
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.35d+90)) then
tmp = -z
else if (z <= 1150000.0d0) 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.35e+90) {
tmp = -z;
} else if (z <= 1150000.0) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.35e+90: tmp = -z elif z <= 1150000.0: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.35e+90) tmp = Float64(-z); elseif (z <= 1150000.0) 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.35e+90) tmp = -z; elseif (z <= 1150000.0) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e+90], (-z), If[LessEqual[z, 1150000.0], (-y), (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+90}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 1150000:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1.35e90 or 1.15e6 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6469.8
Applied rewrites69.8%
if -1.35e90 < z < 1.15e6Initial program 99.8%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
remove-double-negN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
cancel-sign-subN/A
mul-1-negN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6438.9
Applied rewrites38.9%
(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%
Taylor expanded in x around 0
+-commutativeN/A
associate--l+N/A
remove-double-negN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
cancel-sign-subN/A
mul-1-negN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6427.6
Applied rewrites27.6%
herbie shell --seed 2024332
(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)))