
(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 11 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.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (<= t_1 -1e+74)
t_1
(if (<= t_1 -2e+23) (- (- z) y) (if (<= t_1 2e+35) (- (log t) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if (t_1 <= -1e+74) {
tmp = t_1;
} else if (t_1 <= -2e+23) {
tmp = -z - y;
} else if (t_1 <= 2e+35) {
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) :: tmp
t_1 = (x * log(y)) - y
if (t_1 <= (-1d+74)) then
tmp = t_1
else if (t_1 <= (-2d+23)) then
tmp = -z - y
else if (t_1 <= 2d+35) 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)) - y;
double tmp;
if (t_1 <= -1e+74) {
tmp = t_1;
} else if (t_1 <= -2e+23) {
tmp = -z - y;
} else if (t_1 <= 2e+35) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if t_1 <= -1e+74: tmp = t_1 elif t_1 <= -2e+23: tmp = -z - y elif t_1 <= 2e+35: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if (t_1 <= -1e+74) tmp = t_1; elseif (t_1 <= -2e+23) tmp = Float64(Float64(-z) - y); elseif (t_1 <= 2e+35) 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)) - y; tmp = 0.0; if (t_1 <= -1e+74) tmp = t_1; elseif (t_1 <= -2e+23) tmp = -z - y; elseif (t_1 <= 2e+35) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+74], t$95$1, If[LessEqual[t$95$1, -2e+23], N[((-z) - y), $MachinePrecision], If[LessEqual[t$95$1, 2e+35], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+23}:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+35}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -9.99999999999999952e73 or 1.9999999999999999e35 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 84.3%
if -9.99999999999999952e73 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.9999999999999998e23Initial 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 z around inf 87.2%
neg-mul-187.2%
Simplified87.2%
if -1.9999999999999998e23 < (-.f64 (*.f64 x (log.f64 y)) y) < 1.9999999999999999e35Initial 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 93.9%
+-commutative93.9%
associate--l-93.9%
Simplified93.9%
Taylor expanded in y around 0 92.2%
Final simplification87.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (or (<= t_2 -2000000000.0) (not (<= t_2 1e-55)))
(- t_1 (+ y z))
(- (- (log t) z) y))))
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 <= -2000000000.0) || !(t_2 <= 1e-55)) {
tmp = t_1 - (y + z);
} else {
tmp = (log(t) - 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if ((t_2 <= (-2000000000.0d0)) .or. (.not. (t_2 <= 1d-55))) then
tmp = t_1 - (y + z)
else
tmp = (log(t) - z) - y
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 <= -2000000000.0) || !(t_2 <= 1e-55)) {
tmp = t_1 - (y + z);
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if (t_2 <= -2000000000.0) or not (t_2 <= 1e-55): tmp = t_1 - (y + z) else: tmp = (math.log(t) - z) - y 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 <= -2000000000.0) || !(t_2 <= 1e-55)) tmp = Float64(t_1 - Float64(y + z)); else tmp = Float64(Float64(log(t) - z) - y); 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 <= -2000000000.0) || ~((t_2 <= 1e-55))) tmp = t_1 - (y + z); else tmp = (log(t) - z) - y; 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[Or[LessEqual[t$95$2, -2000000000.0], N[Not[LessEqual[t$95$2, 1e-55]], $MachinePrecision]], N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -2000000000 \lor \neg \left(t\_2 \leq 10^{-55}\right):\\
\;\;\;\;t\_1 - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2e9 or 9.99999999999999995e-56 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.3%
if -2e9 < (-.f64 (*.f64 x (log.f64 y)) y) < 9.99999999999999995e-56Initial 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 98.9%
+-commutative98.9%
associate--l-98.9%
Simplified98.9%
Final simplification99.2%
(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))) (t_2 (- (- z) y)))
(if (<= x -7.2e+121)
t_1
(if (<= x 1.45e-276)
t_2
(if (<= x 1.1e-180) (- (log t) y) (if (<= x 1.35e+69) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = -z - y;
double tmp;
if (x <= -7.2e+121) {
tmp = t_1;
} else if (x <= 1.45e-276) {
tmp = t_2;
} else if (x <= 1.1e-180) {
tmp = log(t) - y;
} else if (x <= 1.35e+69) {
tmp = t_2;
} 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 = -z - y
if (x <= (-7.2d+121)) then
tmp = t_1
else if (x <= 1.45d-276) then
tmp = t_2
else if (x <= 1.1d-180) then
tmp = log(t) - y
else if (x <= 1.35d+69) then
tmp = t_2
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 = -z - y;
double tmp;
if (x <= -7.2e+121) {
tmp = t_1;
} else if (x <= 1.45e-276) {
tmp = t_2;
} else if (x <= 1.1e-180) {
tmp = Math.log(t) - y;
} else if (x <= 1.35e+69) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = -z - y tmp = 0 if x <= -7.2e+121: tmp = t_1 elif x <= 1.45e-276: tmp = t_2 elif x <= 1.1e-180: tmp = math.log(t) - y elif x <= 1.35e+69: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(-z) - y) tmp = 0.0 if (x <= -7.2e+121) tmp = t_1; elseif (x <= 1.45e-276) tmp = t_2; elseif (x <= 1.1e-180) tmp = Float64(log(t) - y); elseif (x <= 1.35e+69) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = -z - y; tmp = 0.0; if (x <= -7.2e+121) tmp = t_1; elseif (x <= 1.45e-276) tmp = t_2; elseif (x <= 1.1e-180) tmp = log(t) - y; elseif (x <= 1.35e+69) tmp = t_2; 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[((-z) - y), $MachinePrecision]}, If[LessEqual[x, -7.2e+121], t$95$1, If[LessEqual[x, 1.45e-276], t$95$2, If[LessEqual[x, 1.1e-180], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.35e+69], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(-z\right) - y\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-276}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-180}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+69}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.19999999999999963e121 or 1.3499999999999999e69 < x Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
+-commutative99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
unsub-neg99.7%
fma-undefine99.7%
neg-sub099.7%
associate-+l-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in z around 0 85.3%
Taylor expanded in y around inf 62.0%
sub-neg62.0%
metadata-eval62.0%
+-commutative62.0%
associate-*r/62.0%
mul-1-neg62.0%
distribute-rgt-neg-in62.0%
log-rec62.0%
remove-double-neg62.0%
Simplified62.0%
Taylor expanded in x around inf 71.5%
if -7.19999999999999963e121 < x < 1.44999999999999994e-276 or 1.10000000000000007e-180 < x < 1.3499999999999999e69Initial 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 75.9%
neg-mul-175.9%
Simplified75.9%
if 1.44999999999999994e-276 < x < 1.10000000000000007e-180Initial 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 99.8%
+-commutative99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around 0 68.2%
Final simplification74.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.8e+36) (not (<= x 6e+67))) (- (* x (log y)) y) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e+36) || !(x <= 6e+67)) {
tmp = (x * log(y)) - y;
} else {
tmp = (log(t) - 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 <= (-2.8d+36)) .or. (.not. (x <= 6d+67))) then
tmp = (x * log(y)) - y
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e+36) || !(x <= 6e+67)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.8e+36) or not (x <= 6e+67): tmp = (x * math.log(y)) - y else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.8e+36) || !(x <= 6e+67)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.8e+36) || ~((x <= 6e+67))) tmp = (x * log(y)) - y; else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.8e+36], N[Not[LessEqual[x, 6e+67]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+36} \lor \neg \left(x \leq 6 \cdot 10^{+67}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -2.8000000000000001e36 or 6.0000000000000002e67 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 87.3%
if -2.8000000000000001e36 < x < 6.0000000000000002e67Initial 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-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 95.2%
+-commutative95.2%
associate--l-95.2%
Simplified95.2%
Final simplification92.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7e+119) (not (<= x 4.2e+69))) (* x (log y)) (- (- z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7e+119) || !(x <= 4.2e+69)) {
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 <= (-7d+119)) .or. (.not. (x <= 4.2d+69))) 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 <= -7e+119) || !(x <= 4.2e+69)) {
tmp = x * Math.log(y);
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7e+119) or not (x <= 4.2e+69): tmp = x * math.log(y) else: tmp = -z - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7e+119) || !(x <= 4.2e+69)) 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 <= -7e+119) || ~((x <= 4.2e+69))) tmp = x * log(y); else tmp = -z - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7e+119], N[Not[LessEqual[x, 4.2e+69]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-z) - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+119} \lor \neg \left(x \leq 4.2 \cdot 10^{+69}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if x < -7.0000000000000001e119 or 4.2000000000000003e69 < x Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
+-commutative99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
unsub-neg99.7%
fma-undefine99.7%
neg-sub099.7%
associate-+l-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in z around 0 85.3%
Taylor expanded in y around inf 62.0%
sub-neg62.0%
metadata-eval62.0%
+-commutative62.0%
associate-*r/62.0%
mul-1-neg62.0%
distribute-rgt-neg-in62.0%
log-rec62.0%
remove-double-neg62.0%
Simplified62.0%
Taylor expanded in x around inf 71.5%
if -7.0000000000000001e119 < x < 4.2000000000000003e69Initial 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 72.6%
neg-mul-172.6%
Simplified72.6%
Final simplification72.2%
(FPCore (x y z t) :precision binary64 (if (<= y 6.3e+19) (- (log t) z) (- (- z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.3e+19) {
tmp = log(t) - z;
} 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 <= 6.3d+19) then
tmp = log(t) - z
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 <= 6.3e+19) {
tmp = Math.log(t) - z;
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 6.3e+19: tmp = math.log(t) - z else: tmp = -z - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 6.3e+19) tmp = Float64(log(t) - z); else tmp = Float64(Float64(-z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 6.3e+19) tmp = log(t) - z; else tmp = -z - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 6.3e+19], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[((-z) - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.3 \cdot 10^{+19}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if y < 6.3e19Initial 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 66.4%
+-commutative66.4%
associate--l-66.4%
Simplified66.4%
Taylor expanded in y around 0 65.4%
if 6.3e19 < 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 78.8%
neg-mul-178.8%
Simplified78.8%
Final simplification71.6%
(FPCore (x y z t) :precision binary64 (if (<= y 3.1e+60) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+60) {
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 <= 3.1d+60) 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 <= 3.1e+60) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.1e+60: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.1e+60) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.1e+60) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.1e+60], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{+60}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 3.1000000000000001e60Initial 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 67.3%
+-commutative67.3%
associate--l-67.3%
Simplified67.3%
Taylor expanded in z around inf 42.6%
neg-mul-142.6%
Simplified42.6%
if 3.1000000000000001e60 < 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 y around inf 63.8%
neg-mul-163.8%
Simplified63.8%
Final simplification51.0%
(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.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 59.0%
neg-mul-159.0%
Simplified59.0%
Final simplification59.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 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%
associate-+l-99.8%
sub-neg99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
unsub-neg99.8%
fma-undefine99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 28.5%
neg-mul-128.5%
Simplified28.5%
Final simplification28.5%
herbie shell --seed 2024073
(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)))