
(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 (or (<= t_2 -5e+33) (not (<= t_2 2e-67)))
(- (- t_1 z) y)
(- (log t) (+ y 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 <= -5e+33) || !(t_2 <= 2e-67)) {
tmp = (t_1 - z) - y;
} else {
tmp = log(t) - (y + 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 <= (-5d+33)) .or. (.not. (t_2 <= 2d-67))) then
tmp = (t_1 - z) - y
else
tmp = log(t) - (y + 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 <= -5e+33) || !(t_2 <= 2e-67)) {
tmp = (t_1 - z) - y;
} else {
tmp = Math.log(t) - (y + 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 <= -5e+33) or not (t_2 <= 2e-67): tmp = (t_1 - z) - y else: tmp = math.log(t) - (y + 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 <= -5e+33) || !(t_2 <= 2e-67)) tmp = Float64(Float64(t_1 - z) - y); else tmp = Float64(log(t) - Float64(y + 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 <= -5e+33) || ~((t_2 <= 2e-67))) tmp = (t_1 - z) - y; else tmp = log(t) - (y + 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[Or[LessEqual[t$95$2, -5e+33], N[Not[LessEqual[t$95$2, 2e-67]], $MachinePrecision]], N[(N[(t$95$1 - z), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]]]
\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^{+33} \lor \neg \left(t\_2 \leq 2 \cdot 10^{-67}\right):\\
\;\;\;\;\left(t\_1 - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -4.99999999999999973e33 or 1.99999999999999989e-67 < (-.f64 (*.f64 x (log.f64 y)) y) 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%
fma-undefine99.8%
associate-+r-99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 99.4%
if -4.99999999999999973e33 < (-.f64 (*.f64 x (log.f64 y)) y) < 1.99999999999999989e-67Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 99.3%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 1.15e-6) (- (+ (log t) t_1) z) (- (- t_1 z) y))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 1.15e-6) {
tmp = (log(t) + t_1) - z;
} else {
tmp = (t_1 - 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) :: tmp
t_1 = x * log(y)
if (y <= 1.15d-6) then
tmp = (log(t) + t_1) - z
else
tmp = (t_1 - 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 tmp;
if (y <= 1.15e-6) {
tmp = (Math.log(t) + t_1) - z;
} else {
tmp = (t_1 - z) - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 1.15e-6: tmp = (math.log(t) + t_1) - z else: tmp = (t_1 - z) - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 1.15e-6) tmp = Float64(Float64(log(t) + t_1) - z); else tmp = Float64(Float64(t_1 - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 1.15e-6) tmp = (log(t) + t_1) - z; else tmp = (t_1 - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.15e-6], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - z), $MachinePrecision], N[(N[(t$95$1 - z), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 1.15 \cdot 10^{-6}:\\
\;\;\;\;\left(\log t + t\_1\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - z\right) - y\\
\end{array}
\end{array}
if y < 1.15e-6Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around 0 99.5%
if 1.15e-6 < 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%
fma-undefine99.9%
associate-+r-99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 99.9%
(FPCore (x y z t) :precision binary64 (- (- (+ (log t) (* x (log y))) z) y))
double code(double x, double y, double z, double t) {
return ((log(t) + (x * log(y))) - 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 = ((log(t) + (x * log(y))) - z) - y
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(t) + (x * Math.log(y))) - z) - y;
}
def code(x, y, z, t): return ((math.log(t) + (x * math.log(y))) - z) - y
function code(x, y, z, t) return Float64(Float64(Float64(log(t) + Float64(x * log(y))) - z) - y) end
function tmp = code(x, y, z, t) tmp = ((log(t) + (x * log(y))) - z) - y; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log t + x \cdot \log y\right) - 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%
fma-undefine99.8%
associate-+r-99.8%
Applied egg-rr99.8%
Final simplification99.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
(if (or (<= x -9.2e+144)
(not
(or (<= x 5.9e+32)
(and (not (<= x 5.6e+83))
(or (<= x 1.12e+104)
(and (not (<= x 2.5e+157)) (<= x 3.3e+212)))))))
(* x (log y))
(- (- z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.2e+144) || !((x <= 5.9e+32) || (!(x <= 5.6e+83) && ((x <= 1.12e+104) || (!(x <= 2.5e+157) && (x <= 3.3e+212)))))) {
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 <= (-9.2d+144)) .or. (.not. (x <= 5.9d+32) .or. (.not. (x <= 5.6d+83)) .and. (x <= 1.12d+104) .or. (.not. (x <= 2.5d+157)) .and. (x <= 3.3d+212))) 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 <= -9.2e+144) || !((x <= 5.9e+32) || (!(x <= 5.6e+83) && ((x <= 1.12e+104) || (!(x <= 2.5e+157) && (x <= 3.3e+212)))))) {
tmp = x * Math.log(y);
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -9.2e+144) or not ((x <= 5.9e+32) or (not (x <= 5.6e+83) and ((x <= 1.12e+104) or (not (x <= 2.5e+157) and (x <= 3.3e+212))))): tmp = x * math.log(y) else: tmp = -z - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -9.2e+144) || !((x <= 5.9e+32) || (!(x <= 5.6e+83) && ((x <= 1.12e+104) || (!(x <= 2.5e+157) && (x <= 3.3e+212)))))) 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 <= -9.2e+144) || ~(((x <= 5.9e+32) || (~((x <= 5.6e+83)) && ((x <= 1.12e+104) || (~((x <= 2.5e+157)) && (x <= 3.3e+212))))))) tmp = x * log(y); else tmp = -z - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -9.2e+144], N[Not[Or[LessEqual[x, 5.9e+32], And[N[Not[LessEqual[x, 5.6e+83]], $MachinePrecision], Or[LessEqual[x, 1.12e+104], And[N[Not[LessEqual[x, 2.5e+157]], $MachinePrecision], LessEqual[x, 3.3e+212]]]]]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-z) - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+144} \lor \neg \left(x \leq 5.9 \cdot 10^{+32} \lor \neg \left(x \leq 5.6 \cdot 10^{+83}\right) \land \left(x \leq 1.12 \cdot 10^{+104} \lor \neg \left(x \leq 2.5 \cdot 10^{+157}\right) \land x \leq 3.3 \cdot 10^{+212}\right)\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if x < -9.2000000000000006e144 or 5.89999999999999965e32 < x < 5.6000000000000001e83 or 1.12000000000000003e104 < x < 2.49999999999999988e157 or 3.3e212 < x Initial program 99.5%
associate-+l-99.5%
associate--l-99.5%
Simplified99.5%
Taylor expanded in x around inf 80.2%
if -9.2000000000000006e144 < x < 5.89999999999999965e32 or 5.6000000000000001e83 < x < 1.12000000000000003e104 or 2.49999999999999988e157 < x < 3.3e212Initial 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%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 76.0%
neg-mul-176.0%
Simplified76.0%
Final simplification77.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1.48e+144)
t_1
(if (<= x 5.5e+32)
(- (log t) (+ y z))
(if (or (<= x 1.6e+82)
(not
(or (<= x 2.3e+104)
(and (not (<= x 2.9e+157)) (<= x 4.1e+210)))))
t_1
(- (- z) y))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.48e+144) {
tmp = t_1;
} else if (x <= 5.5e+32) {
tmp = log(t) - (y + z);
} else if ((x <= 1.6e+82) || !((x <= 2.3e+104) || (!(x <= 2.9e+157) && (x <= 4.1e+210)))) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-1.48d+144)) then
tmp = t_1
else if (x <= 5.5d+32) then
tmp = log(t) - (y + z)
else if ((x <= 1.6d+82) .or. (.not. (x <= 2.3d+104) .or. (.not. (x <= 2.9d+157)) .and. (x <= 4.1d+210))) then
tmp = t_1
else
tmp = -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 tmp;
if (x <= -1.48e+144) {
tmp = t_1;
} else if (x <= 5.5e+32) {
tmp = Math.log(t) - (y + z);
} else if ((x <= 1.6e+82) || !((x <= 2.3e+104) || (!(x <= 2.9e+157) && (x <= 4.1e+210)))) {
tmp = t_1;
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.48e+144: tmp = t_1 elif x <= 5.5e+32: tmp = math.log(t) - (y + z) elif (x <= 1.6e+82) or not ((x <= 2.3e+104) or (not (x <= 2.9e+157) and (x <= 4.1e+210))): tmp = t_1 else: tmp = -z - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.48e+144) tmp = t_1; elseif (x <= 5.5e+32) tmp = Float64(log(t) - Float64(y + z)); elseif ((x <= 1.6e+82) || !((x <= 2.3e+104) || (!(x <= 2.9e+157) && (x <= 4.1e+210)))) tmp = t_1; else tmp = Float64(Float64(-z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -1.48e+144) tmp = t_1; elseif (x <= 5.5e+32) tmp = log(t) - (y + z); elseif ((x <= 1.6e+82) || ~(((x <= 2.3e+104) || (~((x <= 2.9e+157)) && (x <= 4.1e+210))))) tmp = t_1; else tmp = -z - y; 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.48e+144], t$95$1, If[LessEqual[x, 5.5e+32], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 1.6e+82], N[Not[Or[LessEqual[x, 2.3e+104], And[N[Not[LessEqual[x, 2.9e+157]], $MachinePrecision], LessEqual[x, 4.1e+210]]]], $MachinePrecision]], t$95$1, N[((-z) - y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.48 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+32}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+82} \lor \neg \left(x \leq 2.3 \cdot 10^{+104} \lor \neg \left(x \leq 2.9 \cdot 10^{+157}\right) \land x \leq 4.1 \cdot 10^{+210}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if x < -1.4800000000000001e144 or 5.49999999999999984e32 < x < 1.59999999999999987e82 or 2.29999999999999985e104 < x < 2.89999999999999988e157 or 4.10000000000000001e210 < x Initial program 99.5%
associate-+l-99.5%
associate--l-99.5%
Simplified99.5%
Taylor expanded in x around inf 80.2%
if -1.4800000000000001e144 < x < 5.49999999999999984e32Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 92.5%
if 1.59999999999999987e82 < x < 2.29999999999999985e104 or 2.89999999999999988e157 < x < 4.10000000000000001e210Initial 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%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 83.0%
neg-mul-183.0%
Simplified83.0%
Final simplification87.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) z)))
(if (<= x -1.4e+114)
t_1
(if (<= x -8.5e+77)
(- (- z) y)
(if (or (<= x -1.15e+32) (not (<= x 2.85e+32)))
t_1
(- (log t) (+ y z)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - z;
double tmp;
if (x <= -1.4e+114) {
tmp = t_1;
} else if (x <= -8.5e+77) {
tmp = -z - y;
} else if ((x <= -1.15e+32) || !(x <= 2.85e+32)) {
tmp = t_1;
} else {
tmp = log(t) - (y + 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)) - z
if (x <= (-1.4d+114)) then
tmp = t_1
else if (x <= (-8.5d+77)) then
tmp = -z - y
else if ((x <= (-1.15d+32)) .or. (.not. (x <= 2.85d+32))) then
tmp = t_1
else
tmp = log(t) - (y + 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)) - z;
double tmp;
if (x <= -1.4e+114) {
tmp = t_1;
} else if (x <= -8.5e+77) {
tmp = -z - y;
} else if ((x <= -1.15e+32) || !(x <= 2.85e+32)) {
tmp = t_1;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - z tmp = 0 if x <= -1.4e+114: tmp = t_1 elif x <= -8.5e+77: tmp = -z - y elif (x <= -1.15e+32) or not (x <= 2.85e+32): tmp = t_1 else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - z) tmp = 0.0 if (x <= -1.4e+114) tmp = t_1; elseif (x <= -8.5e+77) tmp = Float64(Float64(-z) - y); elseif ((x <= -1.15e+32) || !(x <= 2.85e+32)) tmp = t_1; else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - z; tmp = 0.0; if (x <= -1.4e+114) tmp = t_1; elseif (x <= -8.5e+77) tmp = -z - y; elseif ((x <= -1.15e+32) || ~((x <= 2.85e+32))) tmp = t_1; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -1.4e+114], t$95$1, If[LessEqual[x, -8.5e+77], N[((-z) - y), $MachinePrecision], If[Or[LessEqual[x, -1.15e+32], N[Not[LessEqual[x, 2.85e+32]], $MachinePrecision]], t$95$1, N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - z\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{+77}:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{+32} \lor \neg \left(x \leq 2.85 \cdot 10^{+32}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.4e114 or -8.50000000000000018e77 < x < -1.15e32 or 2.85e32 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 87.3%
if -1.4e114 < x < -8.50000000000000018e77Initial 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%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 89.0%
neg-mul-189.0%
Simplified89.0%
if -1.15e32 < x < 2.85e32Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 97.6%
Final simplification92.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (- z) y)))
(if (<= x -2.15e+144)
t_1
(if (<= x -1.05e-124)
t_2
(if (<= x -5.6e-288) (- (log t) y) (if (<= x 2.4e+104) 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 <= -2.15e+144) {
tmp = t_1;
} else if (x <= -1.05e-124) {
tmp = t_2;
} else if (x <= -5.6e-288) {
tmp = log(t) - y;
} else if (x <= 2.4e+104) {
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 <= (-2.15d+144)) then
tmp = t_1
else if (x <= (-1.05d-124)) then
tmp = t_2
else if (x <= (-5.6d-288)) then
tmp = log(t) - y
else if (x <= 2.4d+104) 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 <= -2.15e+144) {
tmp = t_1;
} else if (x <= -1.05e-124) {
tmp = t_2;
} else if (x <= -5.6e-288) {
tmp = Math.log(t) - y;
} else if (x <= 2.4e+104) {
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 <= -2.15e+144: tmp = t_1 elif x <= -1.05e-124: tmp = t_2 elif x <= -5.6e-288: tmp = math.log(t) - y elif x <= 2.4e+104: 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 <= -2.15e+144) tmp = t_1; elseif (x <= -1.05e-124) tmp = t_2; elseif (x <= -5.6e-288) tmp = Float64(log(t) - y); elseif (x <= 2.4e+104) 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 <= -2.15e+144) tmp = t_1; elseif (x <= -1.05e-124) tmp = t_2; elseif (x <= -5.6e-288) tmp = log(t) - y; elseif (x <= 2.4e+104) 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, -2.15e+144], t$95$1, If[LessEqual[x, -1.05e-124], t$95$2, If[LessEqual[x, -5.6e-288], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 2.4e+104], 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 -2.15 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-124}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-288}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+104}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.14999999999999992e144 or 2.4e104 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in x around inf 74.6%
if -2.14999999999999992e144 < x < -1.05e-124 or -5.5999999999999999e-288 < x < 2.4e104Initial 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%
fma-undefine99.9%
associate-+r-99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 76.6%
neg-mul-176.6%
Simplified76.6%
if -1.05e-124 < x < -5.5999999999999999e-288Initial 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%
fma-undefine100.0%
associate-+r-100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 74.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.1) (not (<= x 6.5e+31))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1) || !(x <= 6.5e+31)) {
tmp = (x * log(y)) - y;
} else {
tmp = log(t) - (y + 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 <= (-3.1d0)) .or. (.not. (x <= 6.5d+31))) then
tmp = (x * log(y)) - y
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1) || !(x <= 6.5e+31)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.1) or not (x <= 6.5e+31): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.1) || !(x <= 6.5e+31)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.1) || ~((x <= 6.5e+31))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.1], N[Not[LessEqual[x, 6.5e+31]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \lor \neg \left(x \leq 6.5 \cdot 10^{+31}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -3.10000000000000009 or 6.5000000000000004e31 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 78.6%
if -3.10000000000000009 < x < 6.5000000000000004e31Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 99.7%
Final simplification88.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.6e+53) (not (<= z 3e+74))) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.6e+53) || !(z <= 3e+74)) {
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 ((z <= (-2.6d+53)) .or. (.not. (z <= 3d+74))) 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 ((z <= -2.6e+53) || !(z <= 3e+74)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.6e+53) or not (z <= 3e+74): tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.6e+53) || !(z <= 3e+74)) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.6e+53) || ~((z <= 3e+74))) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.6e+53], N[Not[LessEqual[z, 3e+74]], $MachinePrecision]], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+53} \lor \neg \left(z \leq 3 \cdot 10^{+74}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -2.59999999999999998e53 or 3e74 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 71.2%
neg-mul-171.2%
Simplified71.2%
if -2.59999999999999998e53 < z < 3e74Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 36.3%
neg-mul-136.3%
Simplified36.3%
Final simplification50.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%
fma-undefine99.8%
associate-+r-99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 57.2%
neg-mul-157.2%
Simplified57.2%
(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%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 26.7%
neg-mul-126.7%
Simplified26.7%
herbie shell --seed 2024085
(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)))