
(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 (+ (log t) (- (- (* (log y) x) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((log(y) * x) - 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) + (((log(y) * x) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((Math.log(y) * x) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((math.log(y) * x) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(log(y) * x) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((log(y) * x) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(\log y \cdot x - y\right) - z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (- (* (log y) x) y) z)) (t_2 (- (- z) y))) (if (<= t_1 -1000.0) t_2 (if (<= t_1 2e-11) (log t) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = ((log(y) * x) - y) - z;
double t_2 = -z - y;
double tmp;
if (t_1 <= -1000.0) {
tmp = t_2;
} else if (t_1 <= 2e-11) {
tmp = log(t);
} 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) :: tmp
t_1 = ((log(y) * x) - y) - z
t_2 = -z - y
if (t_1 <= (-1000.0d0)) then
tmp = t_2
else if (t_1 <= 2d-11) then
tmp = log(t)
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(y) * x) - y) - z;
double t_2 = -z - y;
double tmp;
if (t_1 <= -1000.0) {
tmp = t_2;
} else if (t_1 <= 2e-11) {
tmp = Math.log(t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((math.log(y) * x) - y) - z t_2 = -z - y tmp = 0 if t_1 <= -1000.0: tmp = t_2 elif t_1 <= 2e-11: tmp = math.log(t) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(log(y) * x) - y) - z) t_2 = Float64(Float64(-z) - y) tmp = 0.0 if (t_1 <= -1000.0) tmp = t_2; elseif (t_1 <= 2e-11) tmp = log(t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((log(y) * x) - y) - z; t_2 = -z - y; tmp = 0.0; if (t_1 <= -1000.0) tmp = t_2; elseif (t_1 <= 2e-11) tmp = log(t); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$2 = N[((-z) - y), $MachinePrecision]}, If[LessEqual[t$95$1, -1000.0], t$95$2, If[LessEqual[t$95$1, 2e-11], N[Log[t], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\log y \cdot x - y\right) - z\\
t_2 := \left(-z\right) - y\\
\mathbf{if}\;t\_1 \leq -1000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-11}:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -1e3 or 1.99999999999999988e-11 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial program 99.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.6%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6466.3
Applied rewrites66.3%
lift-/.f64N/A
lift-/.f64N/A
remove-double-div66.5
Applied rewrites66.5%
if -1e3 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 1.99999999999999988e-11Initial program 100.0%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.9%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f64100.0
Applied rewrites100.0%
Taylor expanded in z around 0
Applied rewrites99.6%
Taylor expanded in x around 0
Applied rewrites99.3%
Final simplification69.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (log y) x)) (t_2 (- t_1 y))) (if (<= t_2 -2000.0) (- (- z) y) (if (<= t_2 4e+38) (- (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 <= -2000.0) {
tmp = -z - y;
} else if (t_2 <= 4e+38) {
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 <= (-2000.0d0)) then
tmp = -z - y
else if (t_2 <= 4d+38) 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 <= -2000.0) {
tmp = -z - y;
} else if (t_2 <= 4e+38) {
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 <= -2000.0: tmp = -z - y elif t_2 <= 4e+38: 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 <= -2000.0) tmp = Float64(Float64(-z) - y); elseif (t_2 <= 4e+38) 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 <= -2000.0) tmp = -z - y; elseif (t_2 <= 4e+38) 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, -2000.0], N[((-z) - y), $MachinePrecision], If[LessEqual[t$95$2, 4e+38], 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 -2000:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+38}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2e3Initial program 99.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.6%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6470.3
Applied rewrites70.3%
lift-/.f64N/A
lift-/.f64N/A
remove-double-div70.5
Applied rewrites70.5%
if -2e3 < (-.f64 (*.f64 x (log.f64 y)) y) < 3.99999999999999991e38Initial program 100.0%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.7%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6499.1
Applied rewrites99.1%
Taylor expanded in x around 0
Applied rewrites97.5%
if 3.99999999999999991e38 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6480.6
Applied rewrites80.6%
Final simplification78.5%
(FPCore (x y z t) :precision binary64 (if (<= (- (* (log y) x) y) -2000.0) (- (- z) y) (- (log t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (((log(y) * x) - y) <= -2000.0) {
tmp = -z - 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 (((log(y) * x) - y) <= (-2000.0d0)) then
tmp = -z - 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 (((Math.log(y) * x) - y) <= -2000.0) {
tmp = -z - y;
} else {
tmp = Math.log(t) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((math.log(y) * x) - y) <= -2000.0: tmp = -z - y else: tmp = math.log(t) - z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(log(y) * x) - y) <= -2000.0) tmp = Float64(Float64(-z) - y); else tmp = Float64(log(t) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((log(y) * x) - y) <= -2000.0) tmp = -z - y; else tmp = log(t) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision], -2000.0], N[((-z) - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log y \cdot x - y \leq -2000:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\log t - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2e3Initial program 99.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.6%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6470.3
Applied rewrites70.3%
lift-/.f64N/A
lift-/.f64N/A
remove-double-div70.5
Applied rewrites70.5%
if -2e3 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.6%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6499.1
Applied rewrites99.1%
Taylor expanded in x around 0
Applied rewrites69.6%
Final simplification70.1%
(FPCore (x y z t) :precision binary64 (if (<= y 0.215) (- (fma (log y) x (log t)) z) (/ 1.0 (/ 1.0 (- (- (* (log y) x) z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.215) {
tmp = fma(log(y), x, log(t)) - z;
} else {
tmp = 1.0 / (1.0 / (((log(y) * x) - z) - y));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 0.215) tmp = Float64(fma(log(y), x, log(t)) - z); else tmp = Float64(1.0 / Float64(1.0 / Float64(Float64(Float64(log(y) * x) - z) - y))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 0.215], N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(1.0 / N[(1.0 / N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.215:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - z\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\left(\log y \cdot x - z\right) - y}}\\
\end{array}
\end{array}
if y < 0.214999999999999997Initial program 99.8%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6499.3
Applied rewrites99.3%
if 0.214999999999999997 < y Initial program 99.9%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6498.9
Applied rewrites98.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ 1.0 (/ 1.0 (- (- (* (log y) x) z) y))))) (if (<= x -5.8e+15) t_1 (if (<= x 1.32e-11) (- (- (log t) y) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (1.0 / (((log(y) * x) - z) - y));
double tmp;
if (x <= -5.8e+15) {
tmp = t_1;
} else if (x <= 1.32e-11) {
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 = 1.0d0 / (1.0d0 / (((log(y) * x) - z) - y))
if (x <= (-5.8d+15)) then
tmp = t_1
else if (x <= 1.32d-11) 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 = 1.0 / (1.0 / (((Math.log(y) * x) - z) - y));
double tmp;
if (x <= -5.8e+15) {
tmp = t_1;
} else if (x <= 1.32e-11) {
tmp = (Math.log(t) - y) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 / (1.0 / (((math.log(y) * x) - z) - y)) tmp = 0 if x <= -5.8e+15: tmp = t_1 elif x <= 1.32e-11: tmp = (math.log(t) - y) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 / Float64(1.0 / Float64(Float64(Float64(log(y) * x) - z) - y))) tmp = 0.0 if (x <= -5.8e+15) tmp = t_1; elseif (x <= 1.32e-11) 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 = 1.0 / (1.0 / (((log(y) * x) - z) - y)); tmp = 0.0; if (x <= -5.8e+15) tmp = t_1; elseif (x <= 1.32e-11) tmp = (log(t) - y) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(1.0 / N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.8e+15], t$95$1, If[LessEqual[x, 1.32e-11], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{1}{\left(\log y \cdot x - z\right) - y}}\\
\mathbf{if}\;x \leq -5.8 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{-11}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.8e15 or 1.32e-11 < x Initial program 99.7%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6498.2
Applied rewrites98.2%
if -5.8e15 < x < 1.32e-11Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f64100.0
Applied rewrites100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= x -1.6e+52)
(- t_1 y)
(if (<= x 60.0) (- (- (log t) y) z) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -1.6e+52) {
tmp = t_1 - y;
} else if (x <= 60.0) {
tmp = (log(t) - y) - z;
} else {
tmp = 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) :: tmp
t_1 = log(y) * x
if (x <= (-1.6d+52)) then
tmp = t_1 - y
else if (x <= 60.0d0) then
tmp = (log(t) - y) - z
else
tmp = t_1 - z
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 <= -1.6e+52) {
tmp = t_1 - y;
} else if (x <= 60.0) {
tmp = (Math.log(t) - y) - z;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -1.6e+52: tmp = t_1 - y elif x <= 60.0: tmp = (math.log(t) - y) - z else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -1.6e+52) tmp = Float64(t_1 - y); elseif (x <= 60.0) tmp = Float64(Float64(log(t) - y) - z); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; tmp = 0.0; if (x <= -1.6e+52) tmp = t_1 - y; elseif (x <= 60.0) tmp = (log(t) - y) - z; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.6e+52], N[(t$95$1 - y), $MachinePrecision], If[LessEqual[x, 60.0], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+52}:\\
\;\;\;\;t\_1 - y\\
\mathbf{elif}\;x \leq 60:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if x < -1.6e52Initial program 99.5%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.3%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6427.8
Applied rewrites27.8%
lift-/.f64N/A
lift-/.f64N/A
remove-double-div27.9
Applied rewrites27.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6489.9
Applied rewrites89.9%
if -1.6e52 < x < 60Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6499.3
Applied rewrites99.3%
if 60 < x Initial program 99.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.6%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6484.4
Applied rewrites84.4%
Taylor expanded in x around inf
Applied rewrites82.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* (log y) x) z))) (if (<= x -3.2e+52) t_1 (if (<= x 60.0) (- (- (log t) y) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (log(y) * x) - z;
double tmp;
if (x <= -3.2e+52) {
tmp = t_1;
} else if (x <= 60.0) {
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) - z
if (x <= (-3.2d+52)) then
tmp = t_1
else if (x <= 60.0d0) 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) - z;
double tmp;
if (x <= -3.2e+52) {
tmp = t_1;
} else if (x <= 60.0) {
tmp = (Math.log(t) - y) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (math.log(y) * x) - z tmp = 0 if x <= -3.2e+52: tmp = t_1 elif x <= 60.0: tmp = (math.log(t) - y) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(log(y) * x) - z) tmp = 0.0 if (x <= -3.2e+52) tmp = t_1; elseif (x <= 60.0) 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) - z; tmp = 0.0; if (x <= -3.2e+52) tmp = t_1; elseif (x <= 60.0) 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[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -3.2e+52], t$95$1, If[LessEqual[x, 60.0], 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 - z\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 60:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.2e52 or 60 < x Initial program 99.7%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.5%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6484.1
Applied rewrites84.1%
Taylor expanded in x around inf
Applied rewrites82.7%
if -3.2e52 < x < 60Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6499.3
Applied rewrites99.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (log y) x))) (if (<= x -6.2e+137) t_1 (if (<= x 1.1e+132) (- (- (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.2e+137) {
tmp = t_1;
} else if (x <= 1.1e+132) {
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.2d+137)) then
tmp = t_1
else if (x <= 1.1d+132) 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.2e+137) {
tmp = t_1;
} else if (x <= 1.1e+132) {
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.2e+137: tmp = t_1 elif x <= 1.1e+132: 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.2e+137) tmp = t_1; elseif (x <= 1.1e+132) 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.2e+137) tmp = t_1; elseif (x <= 1.1e+132) 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.2e+137], t$95$1, If[LessEqual[x, 1.1e+132], 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.2 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+132}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.1999999999999999e137 or 1.09999999999999994e132 < x Initial program 99.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6480.7
Applied rewrites80.7%
if -6.1999999999999999e137 < x < 1.09999999999999994e132Initial 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 (let* ((t_1 (- (- z) y))) (if (<= z -3.9e+23) t_1 (if (<= z 1.12e-23) (- (log t) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -z - y;
double tmp;
if (z <= -3.9e+23) {
tmp = t_1;
} else if (z <= 1.12e-23) {
tmp = log(t) - 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 = -z - y
if (z <= (-3.9d+23)) then
tmp = t_1
else if (z <= 1.12d-23) then
tmp = log(t) - 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 = -z - y;
double tmp;
if (z <= -3.9e+23) {
tmp = t_1;
} else if (z <= 1.12e-23) {
tmp = Math.log(t) - y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -z - y tmp = 0 if z <= -3.9e+23: tmp = t_1 elif z <= 1.12e-23: tmp = math.log(t) - y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-z) - y) tmp = 0.0 if (z <= -3.9e+23) tmp = t_1; elseif (z <= 1.12e-23) tmp = Float64(log(t) - y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -z - y; tmp = 0.0; if (z <= -3.9e+23) tmp = t_1; elseif (z <= 1.12e-23) tmp = log(t) - y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-z) - y), $MachinePrecision]}, If[LessEqual[z, -3.9e+23], t$95$1, If[LessEqual[z, 1.12e-23], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-z\right) - y\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-23}:\\
\;\;\;\;\log t - y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.9e23 or 1.1200000000000001e-23 < z Initial program 99.9%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.6%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6479.5
Applied rewrites79.5%
lift-/.f64N/A
lift-/.f64N/A
remove-double-div79.7
Applied rewrites79.7%
if -3.9e23 < z < 1.1200000000000001e-23Initial program 99.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.6%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6458.0
Applied rewrites58.0%
Taylor expanded in z around 0
Applied rewrites58.0%
(FPCore (x y z t) :precision binary64 (if (<= y 6.2e+43) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.2e+43) {
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 <= 6.2d+43) 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 <= 6.2e+43) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 6.2e+43: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 6.2e+43) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 6.2e+43) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 6.2e+43], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+43}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 6.2000000000000003e43Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6440.0
Applied rewrites40.0%
if 6.2000000000000003e43 < y Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6459.4
Applied rewrites59.4%
(FPCore (x y z t) :precision binary64 (- (- z) y))
double code(double x, double y, double z, double t) {
return -z - 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 = -z - y
end function
public static double code(double x, double y, double z, double t) {
return -z - y;
}
def code(x, y, z, t): return -z - y
function code(x, y, z, t) return Float64(Float64(-z) - y) end
function tmp = code(x, y, z, t) tmp = -z - y; end
code[x_, y_, z_, t_] := N[((-z) - y), $MachinePrecision]
\begin{array}{l}
\\
\left(-z\right) - y
\end{array}
Initial program 99.9%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites99.6%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6460.3
Applied rewrites60.3%
lift-/.f64N/A
lift-/.f64N/A
remove-double-div60.5
Applied rewrites60.5%
(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 y around inf
mul-1-negN/A
lower-neg.f6430.4
Applied rewrites30.4%
herbie shell --seed 2024276
(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)))