
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (- (fma x (log y) (- (log t) z)) y))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (log(t) - z)) - y;
}
function code(x, y, z, t) return Float64(fma(x, log(y), Float64(log(t) - z)) - y) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
\end{array}
Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
unsub-neg99.8%
fma-undefine99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -4e+151)
t_2
(if (<= t_2 -200000000000.0)
(- (- z) y)
(if (<= t_2 0.02) (- (log t) z) (- t_1 z))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -4e+151) {
tmp = t_2;
} else if (t_2 <= -200000000000.0) {
tmp = -z - y;
} else if (t_2 <= 0.02) {
tmp = log(t) - 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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-4d+151)) then
tmp = t_2
else if (t_2 <= (-200000000000.0d0)) then
tmp = -z - y
else if (t_2 <= 0.02d0) then
tmp = log(t) - 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 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -4e+151) {
tmp = t_2;
} else if (t_2 <= -200000000000.0) {
tmp = -z - y;
} else if (t_2 <= 0.02) {
tmp = Math.log(t) - z;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -4e+151: tmp = t_2 elif t_2 <= -200000000000.0: tmp = -z - y elif t_2 <= 0.02: tmp = math.log(t) - z else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -4e+151) tmp = t_2; elseif (t_2 <= -200000000000.0) tmp = Float64(Float64(-z) - y); elseif (t_2 <= 0.02) tmp = Float64(log(t) - z); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -4e+151) tmp = t_2; elseif (t_2 <= -200000000000.0) tmp = -z - y; elseif (t_2 <= 0.02) tmp = log(t) - z; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+151], t$95$2, If[LessEqual[t$95$2, -200000000000.0], N[((-z) - y), $MachinePrecision], If[LessEqual[t$95$2, 0.02], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+151}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq -200000000000:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{elif}\;t\_2 \leq 0.02:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -4.00000000000000007e151Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 87.9%
if -4.00000000000000007e151 < (-.f64 (*.f64 x (log.f64 y)) y) < -2e11Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
unsub-neg99.9%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 97.8%
associate--l+97.8%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 84.0%
if -2e11 < (-.f64 (*.f64 x (log.f64 y)) y) < 0.0200000000000000004Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
unsub-neg100.0%
fma-undefine100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 99.0%
Taylor expanded in y around 0 96.0%
if 0.0200000000000000004 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 96.9%
Final simplification90.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -4e+151)
t_2
(if (<= t_2 -200000000000.0)
(- (- z) y)
(if (<= t_2 5e+45) (- (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 <= -4e+151) {
tmp = t_2;
} else if (t_2 <= -200000000000.0) {
tmp = -z - y;
} else if (t_2 <= 5e+45) {
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 <= (-4d+151)) then
tmp = t_2
else if (t_2 <= (-200000000000.0d0)) then
tmp = -z - y
else if (t_2 <= 5d+45) 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 <= -4e+151) {
tmp = t_2;
} else if (t_2 <= -200000000000.0) {
tmp = -z - y;
} else if (t_2 <= 5e+45) {
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 <= -4e+151: tmp = t_2 elif t_2 <= -200000000000.0: tmp = -z - y elif t_2 <= 5e+45: 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 <= -4e+151) tmp = t_2; elseif (t_2 <= -200000000000.0) tmp = Float64(Float64(-z) - y); elseif (t_2 <= 5e+45) 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 <= -4e+151) tmp = t_2; elseif (t_2 <= -200000000000.0) tmp = -z - y; elseif (t_2 <= 5e+45) 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, -4e+151], t$95$2, If[LessEqual[t$95$2, -200000000000.0], N[((-z) - y), $MachinePrecision], If[LessEqual[t$95$2, 5e+45], 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 -4 \cdot 10^{+151}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq -200000000000:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+45}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -4.00000000000000007e151Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 87.9%
if -4.00000000000000007e151 < (-.f64 (*.f64 x (log.f64 y)) y) < -2e11Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
unsub-neg99.9%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 97.8%
associate--l+97.8%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 84.0%
if -2e11 < (-.f64 (*.f64 x (log.f64 y)) y) < 5e45Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
unsub-neg99.9%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 92.8%
Taylor expanded in y around 0 90.2%
if 5e45 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
sub-neg99.6%
associate--l+99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in x around inf 84.6%
Taylor expanded in x around inf 84.6%
Final simplification87.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1.6e+53)
(- t_1 y)
(if (<= x 3700000000000.0) (- (- (log t) z) y) (- (+ (log t) t_1) z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.6e+53) {
tmp = t_1 - y;
} else if (x <= 3700000000000.0) {
tmp = (log(t) - z) - y;
} else {
tmp = (log(t) + t_1) - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-1.6d+53)) then
tmp = t_1 - y
else if (x <= 3700000000000.0d0) then
tmp = (log(t) - z) - y
else
tmp = (log(t) + t_1) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if (x <= -1.6e+53) {
tmp = t_1 - y;
} else if (x <= 3700000000000.0) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = (Math.log(t) + t_1) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.6e+53: tmp = t_1 - y elif x <= 3700000000000.0: tmp = (math.log(t) - z) - y else: tmp = (math.log(t) + t_1) - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.6e+53) tmp = Float64(t_1 - y); elseif (x <= 3700000000000.0) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(Float64(log(t) + t_1) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -1.6e+53) tmp = t_1 - y; elseif (x <= 3700000000000.0) tmp = (log(t) - z) - y; else tmp = (log(t) + t_1) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+53], N[(t$95$1 - y), $MachinePrecision], If[LessEqual[x, 3700000000000.0], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+53}:\\
\;\;\;\;t\_1 - y\\
\mathbf{elif}\;x \leq 3700000000000:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t + t\_1\right) - z\\
\end{array}
\end{array}
if x < -1.6e53Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 93.7%
if -1.6e53 < x < 3.7e12Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
unsub-neg100.0%
fma-undefine100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 96.5%
if 3.7e12 < x Initial program 99.6%
sub-neg99.6%
associate--l+99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in y around 0 85.6%
(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(x * log(y)) - Float64(y + Float64(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[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + N[(z - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \log y - \left(y + \left(z - \log t\right)\right)
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((x * log(y)) - y) - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = log(t) + (((x * log(y)) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((x * Math.log(y)) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((x * math.log(y)) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(x * log(y)) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((x * log(y)) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(x \cdot \log y - y\right) - z\right)
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2.95e+51)
(- t_1 y)
(if (<= x 3800000000000.0) (- (- (log t) z) y) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -2.95e+51) {
tmp = t_1 - y;
} else if (x <= 3800000000000.0) {
tmp = (log(t) - z) - y;
} 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 = x * log(y)
if (x <= (-2.95d+51)) then
tmp = t_1 - y
else if (x <= 3800000000000.0d0) then
tmp = (log(t) - z) - y
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 = x * Math.log(y);
double tmp;
if (x <= -2.95e+51) {
tmp = t_1 - y;
} else if (x <= 3800000000000.0) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -2.95e+51: tmp = t_1 - y elif x <= 3800000000000.0: tmp = (math.log(t) - z) - y else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2.95e+51) tmp = Float64(t_1 - y); elseif (x <= 3800000000000.0) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -2.95e+51) tmp = t_1 - y; elseif (x <= 3800000000000.0) tmp = (log(t) - z) - y; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.95e+51], N[(t$95$1 - y), $MachinePrecision], If[LessEqual[x, 3800000000000.0], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2.95 \cdot 10^{+51}:\\
\;\;\;\;t\_1 - y\\
\mathbf{elif}\;x \leq 3800000000000:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if x < -2.94999999999999991e51Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 93.7%
if -2.94999999999999991e51 < x < 3.8e12Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
unsub-neg100.0%
fma-undefine100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 96.5%
if 3.8e12 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 85.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.2e+170) (not (<= x 3e+128))) (* x (log y)) (- (- z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.2e+170) || !(x <= 3e+128)) {
tmp = x * log(y);
} else {
tmp = -z - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-5.2d+170)) .or. (.not. (x <= 3d+128))) then
tmp = x * log(y)
else
tmp = -z - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.2e+170) || !(x <= 3e+128)) {
tmp = x * Math.log(y);
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.2e+170) or not (x <= 3e+128): tmp = x * math.log(y) else: tmp = -z - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.2e+170) || !(x <= 3e+128)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.2e+170) || ~((x <= 3e+128))) tmp = x * log(y); else tmp = -z - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.2e+170], N[Not[LessEqual[x, 3e+128]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-z) - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+170} \lor \neg \left(x \leq 3 \cdot 10^{+128}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if x < -5.1999999999999996e170 or 2.9999999999999998e128 < x Initial program 99.6%
sub-neg99.6%
associate--l+99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in x around inf 77.5%
Taylor expanded in x around inf 77.5%
if -5.1999999999999996e170 < x < 2.9999999999999998e128Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
unsub-neg99.9%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 96.8%
associate--l+96.8%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 71.1%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (if (<= y 1.95e-219) (log t) (- (- z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.95e-219) {
tmp = log(t);
} else {
tmp = -z - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.95d-219) then
tmp = log(t)
else
tmp = -z - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.95e-219) {
tmp = Math.log(t);
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.95e-219: tmp = math.log(t) else: tmp = -z - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.95e-219) tmp = log(t); else tmp = Float64(Float64(-z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.95e-219) tmp = log(t); else tmp = -z - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.95e-219], N[Log[t], $MachinePrecision], N[((-z) - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.95 \cdot 10^{-219}:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if y < 1.94999999999999994e-219Initial program 99.7%
sub-neg99.7%
associate--l+99.7%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 44.3%
mul-1-neg44.3%
Simplified44.3%
Taylor expanded in y around 0 44.3%
if 1.94999999999999994e-219 < y Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
unsub-neg99.9%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 89.3%
associate--l+89.3%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in z around inf 63.2%
Final simplification60.1%
(FPCore (x y z t) :precision binary64 (if (<= y 9.2e+101) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.2e+101) {
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 <= 9.2d+101) 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 <= 9.2e+101) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 9.2e+101: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 9.2e+101) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 9.2e+101) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 9.2e+101], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{+101}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 9.2000000000000005e101Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
unsub-neg99.8%
fma-undefine99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 65.2%
Taylor expanded in z around inf 36.6%
neg-mul-136.6%
Simplified36.6%
if 9.2000000000000005e101 < y Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 69.6%
mul-1-neg69.6%
Simplified69.6%
Taylor expanded in y around inf 69.6%
mul-1-neg69.6%
Simplified69.6%
(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%
associate-+l-99.8%
sub-neg99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
unsub-neg99.8%
fma-undefine99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 89.2%
associate--l+89.2%
associate-/l*89.2%
Simplified89.2%
Taylor expanded in z around inf 57.1%
Final simplification57.1%
(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%
sub-neg99.8%
associate--l+99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 44.1%
mul-1-neg44.1%
Simplified44.1%
Taylor expanded in y around inf 31.0%
mul-1-neg31.0%
Simplified31.0%
(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 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%
sub-neg99.8%
associate--l+99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 44.1%
mul-1-neg44.1%
Simplified44.1%
Taylor expanded in y around inf 31.0%
mul-1-neg31.0%
Simplified31.0%
add-sqr-sqrt0.0%
sqrt-unprod2.1%
sqr-neg2.1%
sqrt-unprod2.2%
add-sqr-sqrt2.2%
add-exp-log2.2%
add-cube-cbrt2.2%
unpow22.2%
sum-log2.2%
+-commutative2.2%
exp-sum2.2%
add-exp-log2.2%
add-exp-log2.2%
Applied egg-rr2.2%
unpow22.2%
rem-3cbrt-rft2.2%
Simplified2.2%
herbie shell --seed 2024152
(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)))