
(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 15 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) z) y)))
double code(double x, double y, double z, double t) {
return fma(log(y), x, ((log(t) - z) - y));
}
function code(x, y, z, t) return fma(log(y), x, Float64(Float64(log(t) - z) - y)) end
code[x_, y_, z_, t_] := N[(N[Log[y], $MachinePrecision] * x + N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log y, x, \left(\log t - z\right) - y\right)
\end{array}
Initial program 99.8%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+l-N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
associate-+r-N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -2e+184)
(fma (log y) x (- y))
(if (<= t_2 -5e+15)
(* (- (/ t_1 y) (- (/ z y) -1.0)) y)
(if (<= t_2 100.0) (- (- (log t) y) z) (fma (log y) x (- 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 <= -2e+184) {
tmp = fma(log(y), x, -y);
} else if (t_2 <= -5e+15) {
tmp = ((t_1 / y) - ((z / y) - -1.0)) * y;
} else if (t_2 <= 100.0) {
tmp = (log(t) - y) - z;
} else {
tmp = fma(log(y), x, -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 <= -2e+184) tmp = fma(log(y), x, Float64(-y)); elseif (t_2 <= -5e+15) tmp = Float64(Float64(Float64(t_1 / y) - Float64(Float64(z / y) - -1.0)) * y); elseif (t_2 <= 100.0) tmp = Float64(Float64(log(t) - y) - z); else tmp = fma(log(y), x, Float64(-z)); 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, -2e+184], N[(N[Log[y], $MachinePrecision] * x + (-y)), $MachinePrecision], If[LessEqual[t$95$2, -5e+15], N[(N[(N[(t$95$1 / y), $MachinePrecision] - N[(N[(z / y), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$2, 100.0], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + (-z)), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+184}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -y\right)\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+15}:\\
\;\;\;\;\left(\frac{t\_1}{y} - \left(\frac{z}{y} - -1\right)\right) \cdot y\\
\mathbf{elif}\;t\_2 \leq 100:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -z\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2.00000000000000003e184Initial program 99.8%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+l-N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
associate-+r-N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6493.7
Applied rewrites93.7%
if -2.00000000000000003e184 < (-.f64 (*.f64 x (log.f64 y)) y) < -5e15Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.0%
Taylor expanded in x around inf
Applied rewrites90.9%
if -5e15 < (-.f64 (*.f64 x (log.f64 y)) y) < 100Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6498.7
Applied rewrites98.7%
if 100 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+l-N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
associate-+r-N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6499.6
Applied rewrites99.6%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6496.6
Applied rewrites96.6%
Final simplification94.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -5e+278)
t_1
(if (<= t_2 -5e+22) (- (- z) y) (if (<= t_2 2e+22) (- (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+278) {
tmp = t_1;
} else if (t_2 <= -5e+22) {
tmp = -z - y;
} else if (t_2 <= 2e+22) {
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 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-5d+278)) then
tmp = t_1
else if (t_2 <= (-5d+22)) then
tmp = -z - y
else if (t_2 <= 2d+22) 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 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -5e+278) {
tmp = t_1;
} else if (t_2 <= -5e+22) {
tmp = -z - y;
} else if (t_2 <= 2e+22) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -5e+278: tmp = t_1 elif t_2 <= -5e+22: tmp = -z - y elif t_2 <= 2e+22: tmp = math.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+278) tmp = t_1; elseif (t_2 <= -5e+22) tmp = Float64(Float64(-z) - y); elseif (t_2 <= 2e+22) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -5e+278) tmp = t_1; elseif (t_2 <= -5e+22) tmp = -z - y; elseif (t_2 <= 2e+22) tmp = log(t) - 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]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+278], t$95$1, If[LessEqual[t$95$2, -5e+22], N[((-z) - y), $MachinePrecision], If[LessEqual[t$95$2, 2e+22], 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^{+278}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+22}:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+22}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.00000000000000029e278 or 2e22 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6478.7
Applied rewrites78.7%
if -5.00000000000000029e278 < (-.f64 (*.f64 x (log.f64 y)) y) < -4.9999999999999996e22Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6450.8
Applied rewrites50.8%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6474.4
Applied rewrites74.4%
Taylor expanded in z around inf
Applied rewrites74.3%
if -4.9999999999999996e22 < (-.f64 (*.f64 x (log.f64 y)) y) < 2e22Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f643.2
Applied rewrites3.2%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6492.2
Applied rewrites92.2%
Taylor expanded in y around 0
Applied rewrites88.7%
Final simplification79.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (- (* x (log y)) y) z))) (if (<= t_1 -4e+22) (- (- z) y) (if (<= t_1 1e+34) (log t) (- z)))))
double code(double x, double y, double z, double t) {
double t_1 = ((x * log(y)) - y) - z;
double tmp;
if (t_1 <= -4e+22) {
tmp = -z - y;
} else if (t_1 <= 1e+34) {
tmp = log(t);
} 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) :: t_1
real(8) :: tmp
t_1 = ((x * log(y)) - y) - z
if (t_1 <= (-4d+22)) then
tmp = -z - y
else if (t_1 <= 1d+34) then
tmp = log(t)
else
tmp = -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)) - y) - z;
double tmp;
if (t_1 <= -4e+22) {
tmp = -z - y;
} else if (t_1 <= 1e+34) {
tmp = Math.log(t);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x * math.log(y)) - y) - z tmp = 0 if t_1 <= -4e+22: tmp = -z - y elif t_1 <= 1e+34: tmp = math.log(t) else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x * log(y)) - y) - z) tmp = 0.0 if (t_1 <= -4e+22) tmp = Float64(Float64(-z) - y); elseif (t_1 <= 1e+34) tmp = log(t); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x * log(y)) - y) - z; tmp = 0.0; if (t_1 <= -4e+22) tmp = -z - y; elseif (t_1 <= 1e+34) tmp = log(t); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+22], N[((-z) - y), $MachinePrecision], If[LessEqual[t$95$1, 1e+34], N[Log[t], $MachinePrecision], (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \log y - y\right) - z\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+22}:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{elif}\;t\_1 \leq 10^{+34}:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -4e22Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6446.7
Applied rewrites46.7%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6471.4
Applied rewrites71.4%
Taylor expanded in z around inf
Applied rewrites71.4%
if -4e22 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 9.99999999999999946e33Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f643.6
Applied rewrites3.6%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6481.6
Applied rewrites81.6%
Taylor expanded in y around 0
Applied rewrites75.5%
Taylor expanded in z around 0
Applied rewrites72.9%
if 9.99999999999999946e33 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6444.8
Applied rewrites44.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (fma (- (/ (* x (log y)) y) 1.0) (/ y z) -1.0) z)))
(if (<= z -1.05e+113)
t_1
(if (<= z 12500000.0) (- (fma (log y) x (log t)) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma((((x * log(y)) / y) - 1.0), (y / z), -1.0) * z;
double tmp;
if (z <= -1.05e+113) {
tmp = t_1;
} else if (z <= 12500000.0) {
tmp = fma(log(y), x, log(t)) - y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(fma(Float64(Float64(Float64(x * log(y)) / y) - 1.0), Float64(y / z), -1.0) * z) tmp = 0.0 if (z <= -1.05e+113) tmp = t_1; elseif (z <= 12500000.0) tmp = Float64(fma(log(y), x, log(t)) - y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] - 1.0), $MachinePrecision] * N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.05e+113], t$95$1, If[LessEqual[z, 12500000.0], N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x \cdot \log y}{y} - 1, \frac{y}{z}, -1\right) \cdot z\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 12500000:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.0499999999999999e113 or 1.25e7 < z Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.4%
Taylor expanded in z around inf
Applied rewrites93.1%
Taylor expanded in x around inf
Applied rewrites93.1%
if -1.0499999999999999e113 < z < 1.25e7Initial 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.f6496.5
Applied rewrites96.5%
Final simplification95.2%
(FPCore (x y z t) :precision binary64 (if (<= (- (* x (log y)) y) -5e+22) (- (- z) y) (- (log t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * log(y)) - y) <= -5e+22) {
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 (((x * log(y)) - y) <= (-5d+22)) 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 (((x * Math.log(y)) - y) <= -5e+22) {
tmp = -z - y;
} else {
tmp = Math.log(t) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * math.log(y)) - y) <= -5e+22: tmp = -z - y else: tmp = math.log(t) - z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * log(y)) - y) <= -5e+22) 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 (((x * log(y)) - y) <= -5e+22) tmp = -z - y; else tmp = log(t) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], -5e+22], N[((-z) - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot \log y - y \leq -5 \cdot 10^{+22}:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\log t - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -4.9999999999999996e22Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6448.9
Applied rewrites48.9%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6470.0
Applied rewrites70.0%
Taylor expanded in z around inf
Applied rewrites70.0%
if -4.9999999999999996e22 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f642.4
Applied rewrites2.4%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6460.9
Applied rewrites60.9%
Taylor expanded in y around 0
Applied rewrites59.1%
(FPCore (x y z t) :precision binary64 (if (<= y 3.3e+19) (fma (log y) x (- (log t) z)) (* (- (/ (* x (log y)) y) (- (/ z y) -1.0)) y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e+19) {
tmp = fma(log(y), x, (log(t) - z));
} else {
tmp = (((x * log(y)) / y) - ((z / y) - -1.0)) * y;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e+19) tmp = fma(log(y), x, Float64(log(t) - z)); else tmp = Float64(Float64(Float64(Float64(x * log(y)) / y) - Float64(Float64(z / y) - -1.0)) * y); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e+19], N[(N[Log[y], $MachinePrecision] * x + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] - N[(N[(z / y), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t - z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{x \cdot \log y}{y} - \left(\frac{z}{y} - -1\right)\right) \cdot y\\
\end{array}
\end{array}
if y < 3.3e19Initial program 99.7%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+l-N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
associate-+r-N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
lower--.f64N/A
lower-log.f6498.0
Applied rewrites98.0%
if 3.3e19 < y Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites99.9%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (if (<= y 3.3e+19) (- (fma (log y) x (log t)) z) (* (- (/ (* x (log y)) y) (- (/ z y) -1.0)) y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e+19) {
tmp = fma(log(y), x, log(t)) - z;
} else {
tmp = (((x * log(y)) / y) - ((z / y) - -1.0)) * y;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e+19) tmp = Float64(fma(log(y), x, log(t)) - z); else tmp = Float64(Float64(Float64(Float64(x * log(y)) / y) - Float64(Float64(z / y) - -1.0)) * y); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e+19], N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] - N[(N[(z / y), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{x \cdot \log y}{y} - \left(\frac{z}{y} - -1\right)\right) \cdot y\\
\end{array}
\end{array}
if y < 3.3e19Initial program 99.7%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6497.9
Applied rewrites97.9%
if 3.3e19 < y Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites99.9%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Initial program 99.8%
(FPCore (x y z t) :precision binary64 (if (<= x -2.4e+20) (fma (log y) x (- y)) (if (<= x 30000000000000.0) (- (- (log t) y) z) (fma (log y) x (- z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.4e+20) {
tmp = fma(log(y), x, -y);
} else if (x <= 30000000000000.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 <= -2.4e+20) tmp = fma(log(y), x, Float64(-y)); elseif (x <= 30000000000000.0) tmp = Float64(Float64(log(t) - y) - z); else tmp = fma(log(y), x, Float64(-z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.4e+20], N[(N[Log[y], $MachinePrecision] * x + (-y)), $MachinePrecision], If[LessEqual[x, 30000000000000.0], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -y\right)\\
\mathbf{elif}\;x \leq 30000000000000:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -z\right)\\
\end{array}
\end{array}
if x < -2.4e20Initial program 99.6%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+l-N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
associate-+r-N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6499.7
Applied rewrites99.7%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6487.9
Applied rewrites87.9%
if -2.4e20 < x < 3e13Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6497.2
Applied rewrites97.2%
if 3e13 < x Initial program 99.7%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+l-N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
associate-+r-N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6499.7
Applied rewrites99.7%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6483.9
Applied rewrites83.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma (log y) x (- y)))) (if (<= x -2.4e+20) t_1 (if (<= x 1.12e+77) (- (- (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 <= -2.4e+20) {
tmp = t_1;
} else if (x <= 1.12e+77) {
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 <= -2.4e+20) tmp = t_1; elseif (x <= 1.12e+77) 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[Log[y], $MachinePrecision] * x + (-y)), $MachinePrecision]}, If[LessEqual[x, -2.4e+20], t$95$1, If[LessEqual[x, 1.12e+77], 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, -y\right)\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{+77}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.4e20 or 1.1199999999999999e77 < x Initial program 99.7%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
associate-+l-N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
associate-+r-N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6499.7
Applied rewrites99.7%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6487.8
Applied rewrites87.8%
if -2.4e20 < x < 1.1199999999999999e77Initial program 99.9%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6493.2
Applied rewrites93.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= x -9.5e+99) t_1 (if (<= x 2.65e+144) (- (- (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 <= -9.5e+99) {
tmp = t_1;
} else if (x <= 2.65e+144) {
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 <= (-9.5d+99)) then
tmp = t_1
else if (x <= 2.65d+144) 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 <= -9.5e+99) {
tmp = t_1;
} else if (x <= 2.65e+144) {
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 <= -9.5e+99: tmp = t_1 elif x <= 2.65e+144: 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 <= -9.5e+99) tmp = t_1; elseif (x <= 2.65e+144) 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 = x * log(y); tmp = 0.0; if (x <= -9.5e+99) tmp = t_1; elseif (x <= 2.65e+144) 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, -9.5e+99], t$95$1, If[LessEqual[x, 2.65e+144], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.65 \cdot 10^{+144}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.49999999999999908e99 or 2.6499999999999998e144 < x Initial program 99.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6479.7
Applied rewrites79.7%
if -9.49999999999999908e99 < x < 2.6499999999999998e144Initial program 99.9%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6488.6
Applied rewrites88.6%
Final simplification85.8%
(FPCore (x y z t) :precision binary64 (if (<= z -8e+112) (- z) (if (<= z 21.5) (- y) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8e+112) {
tmp = -z;
} else if (z <= 21.5) {
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 <= (-8d+112)) then
tmp = -z
else if (z <= 21.5d0) 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 <= -8e+112) {
tmp = -z;
} else if (z <= 21.5) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8e+112: tmp = -z elif z <= 21.5: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8e+112) tmp = Float64(-z); elseif (z <= 21.5) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8e+112) tmp = -z; elseif (z <= 21.5) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8e+112], (-z), If[LessEqual[z, 21.5], (-y), (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+112}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 21.5:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -7.9999999999999994e112 or 21.5 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6463.0
Applied rewrites63.0%
if -7.9999999999999994e112 < z < 21.5Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6436.8
Applied rewrites36.8%
(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.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6427.8
Applied rewrites27.8%
Taylor expanded in x around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6465.9
Applied rewrites65.9%
Taylor expanded in z around inf
Applied rewrites53.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.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6427.8
Applied rewrites27.8%
herbie shell --seed 2024277
(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)))