
(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 (+ (- (- (* 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.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= z -8500000000000.0)
(- t_1 z)
(if (<= z 2.9e+55) (- (+ (log t) t_1) y) (- (- z) y)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (z <= -8500000000000.0) {
tmp = t_1 - z;
} else if (z <= 2.9e+55) {
tmp = (log(t) + t_1) - 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (z <= (-8500000000000.0d0)) then
tmp = t_1 - z
else if (z <= 2.9d+55) then
tmp = (log(t) + t_1) - y
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 (z <= -8500000000000.0) {
tmp = t_1 - z;
} else if (z <= 2.9e+55) {
tmp = (Math.log(t) + t_1) - y;
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if z <= -8500000000000.0: tmp = t_1 - z elif z <= 2.9e+55: tmp = (math.log(t) + t_1) - y else: tmp = -z - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (z <= -8500000000000.0) tmp = Float64(t_1 - z); elseif (z <= 2.9e+55) tmp = Float64(Float64(log(t) + t_1) - y); 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 (z <= -8500000000000.0) tmp = t_1 - z; elseif (z <= 2.9e+55) tmp = (log(t) + t_1) - y; 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[z, -8500000000000.0], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[z, 2.9e+55], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - y), $MachinePrecision], N[((-z) - y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;z \leq -8500000000000:\\
\;\;\;\;t_1 - z\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+55}:\\
\;\;\;\;\left(\log t + t_1\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if z < -8.5e12Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
associate--l+100.0%
add-cube-cbrt99.6%
associate-*r*99.6%
fma-def99.6%
pow299.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.2%
Taylor expanded in y around 0 85.0%
pow-base-185.0%
associate-*r*85.0%
*-lft-identity85.0%
Simplified85.0%
if -8.5e12 < z < 2.8999999999999999e55Initial program 99.8%
Taylor expanded in z around 0 97.6%
if 2.8999999999999999e55 < z Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
associate--l+100.0%
add-cube-cbrt100.0%
associate-*r*99.9%
fma-def99.9%
pow299.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in x around 0 91.2%
mul-1-neg91.2%
+-commutative91.2%
distribute-neg-in91.2%
sub-neg91.2%
Simplified91.2%
Final simplification92.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (log t) (* x (log y)))))
(if (<= z -5000000000000.0)
(- t_1 z)
(if (<= z 1.5e+55) (- t_1 y) (- (- z) y)))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) + (x * log(y));
double tmp;
if (z <= -5000000000000.0) {
tmp = t_1 - z;
} else if (z <= 1.5e+55) {
tmp = t_1 - 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) :: t_1
real(8) :: tmp
t_1 = log(t) + (x * log(y))
if (z <= (-5000000000000.0d0)) then
tmp = t_1 - z
else if (z <= 1.5d+55) then
tmp = t_1 - y
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 = Math.log(t) + (x * Math.log(y));
double tmp;
if (z <= -5000000000000.0) {
tmp = t_1 - z;
} else if (z <= 1.5e+55) {
tmp = t_1 - y;
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) + (x * math.log(y)) tmp = 0 if z <= -5000000000000.0: tmp = t_1 - z elif z <= 1.5e+55: tmp = t_1 - y else: tmp = -z - y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) + Float64(x * log(y))) tmp = 0.0 if (z <= -5000000000000.0) tmp = Float64(t_1 - z); elseif (z <= 1.5e+55) tmp = Float64(t_1 - y); else tmp = Float64(Float64(-z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) + (x * log(y)); tmp = 0.0; if (z <= -5000000000000.0) tmp = t_1 - z; elseif (z <= 1.5e+55) tmp = t_1 - y; else tmp = -z - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5000000000000.0], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[z, 1.5e+55], N[(t$95$1 - y), $MachinePrecision], N[((-z) - y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t + x \cdot \log y\\
\mathbf{if}\;z \leq -5000000000000:\\
\;\;\;\;t_1 - z\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+55}:\\
\;\;\;\;t_1 - y\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if z < -5e12Initial program 100.0%
Taylor expanded in y around 0 85.4%
if -5e12 < z < 1.50000000000000008e55Initial program 99.8%
Taylor expanded in z around 0 97.6%
if 1.50000000000000008e55 < z Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
associate--l+100.0%
add-cube-cbrt100.0%
associate-*r*99.9%
fma-def99.9%
pow299.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in x around 0 91.2%
mul-1-neg91.2%
+-commutative91.2%
distribute-neg-in91.2%
sub-neg91.2%
Simplified91.2%
Final simplification93.0%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -3.8e+143)
(and (not (<= x -2.5e+96))
(or (<= x -1.45e+40) (not (<= x 2.5e+125)))))
(- (* x (log y)) y)
(- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.8e+143) || (!(x <= -2.5e+96) && ((x <= -1.45e+40) || !(x <= 2.5e+125)))) {
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.8d+143)) .or. (.not. (x <= (-2.5d+96))) .and. (x <= (-1.45d+40)) .or. (.not. (x <= 2.5d+125))) 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.8e+143) || (!(x <= -2.5e+96) && ((x <= -1.45e+40) || !(x <= 2.5e+125)))) {
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.8e+143) or (not (x <= -2.5e+96) and ((x <= -1.45e+40) or not (x <= 2.5e+125))): 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.8e+143) || (!(x <= -2.5e+96) && ((x <= -1.45e+40) || !(x <= 2.5e+125)))) 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.8e+143) || (~((x <= -2.5e+96)) && ((x <= -1.45e+40) || ~((x <= 2.5e+125))))) 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.8e+143], And[N[Not[LessEqual[x, -2.5e+96]], $MachinePrecision], Or[LessEqual[x, -1.45e+40], N[Not[LessEqual[x, 2.5e+125]], $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.8 \cdot 10^{+143} \lor \neg \left(x \leq -2.5 \cdot 10^{+96}\right) \land \left(x \leq -1.45 \cdot 10^{+40} \lor \neg \left(x \leq 2.5 \cdot 10^{+125}\right)\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -3.8e143 or -2.5000000000000002e96 < x < -1.45000000000000009e40 or 2.49999999999999981e125 < x Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
associate--l+99.7%
add-cube-cbrt98.7%
associate-*r*98.7%
fma-def98.7%
pow298.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 98.7%
Taylor expanded in z around 0 87.0%
pow-base-187.0%
*-commutative87.0%
*-lft-identity87.0%
*-commutative87.0%
Simplified87.0%
if -3.8e143 < x < -2.5000000000000002e96 or -1.45000000000000009e40 < x < 2.49999999999999981e125Initial program 100.0%
Taylor expanded in x around 0 93.1%
Final simplification91.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 z)))
(if (<= x -9.5e+20)
t_2
(if (<= x 9.8e+41)
(- (log t) (+ y z))
(if (<= x 1.25e+93) t_2 (if (<= x 2.2e+125) (- (- z) y) (- t_1 y)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - z;
double tmp;
if (x <= -9.5e+20) {
tmp = t_2;
} else if (x <= 9.8e+41) {
tmp = log(t) - (y + z);
} else if (x <= 1.25e+93) {
tmp = t_2;
} else if (x <= 2.2e+125) {
tmp = -z - y;
} else {
tmp = t_1 - 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 - z
if (x <= (-9.5d+20)) then
tmp = t_2
else if (x <= 9.8d+41) then
tmp = log(t) - (y + z)
else if (x <= 1.25d+93) then
tmp = t_2
else if (x <= 2.2d+125) then
tmp = -z - y
else
tmp = t_1 - 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 - z;
double tmp;
if (x <= -9.5e+20) {
tmp = t_2;
} else if (x <= 9.8e+41) {
tmp = Math.log(t) - (y + z);
} else if (x <= 1.25e+93) {
tmp = t_2;
} else if (x <= 2.2e+125) {
tmp = -z - y;
} else {
tmp = t_1 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - z tmp = 0 if x <= -9.5e+20: tmp = t_2 elif x <= 9.8e+41: tmp = math.log(t) - (y + z) elif x <= 1.25e+93: tmp = t_2 elif x <= 2.2e+125: tmp = -z - y else: tmp = t_1 - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - z) tmp = 0.0 if (x <= -9.5e+20) tmp = t_2; elseif (x <= 9.8e+41) tmp = Float64(log(t) - Float64(y + z)); elseif (x <= 1.25e+93) tmp = t_2; elseif (x <= 2.2e+125) tmp = Float64(Float64(-z) - y); else tmp = Float64(t_1 - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - z; tmp = 0.0; if (x <= -9.5e+20) tmp = t_2; elseif (x <= 9.8e+41) tmp = log(t) - (y + z); elseif (x <= 1.25e+93) tmp = t_2; elseif (x <= 2.2e+125) tmp = -z - y; else tmp = t_1 - 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 - z), $MachinePrecision]}, If[LessEqual[x, -9.5e+20], t$95$2, If[LessEqual[x, 9.8e+41], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.25e+93], t$95$2, If[LessEqual[x, 2.2e+125], N[((-z) - y), $MachinePrecision], N[(t$95$1 - y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t_1 - z\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+20}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 9.8 \cdot 10^{+41}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+93}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+125}:\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t_1 - y\\
\end{array}
\end{array}
if x < -9.5e20 or 9.7999999999999998e41 < x < 1.25e93Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
add-cube-cbrt99.2%
associate-*r*99.1%
fma-def99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 99.2%
Taylor expanded in y around 0 84.6%
pow-base-184.6%
associate-*r*84.6%
*-lft-identity84.6%
Simplified84.6%
if -9.5e20 < x < 9.7999999999999998e41Initial program 100.0%
Taylor expanded in x around 0 98.7%
if 1.25e93 < x < 2.19999999999999991e125Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
associate--l+100.0%
add-cube-cbrt100.0%
associate-*r*100.0%
fma-def100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 100.0%
Taylor expanded in x around 0 87.6%
mul-1-neg87.6%
+-commutative87.6%
distribute-neg-in87.6%
sub-neg87.6%
Simplified87.6%
if 2.19999999999999991e125 < x Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
add-cube-cbrt98.4%
associate-*r*98.5%
fma-def98.5%
pow298.5%
Applied egg-rr98.5%
Taylor expanded in z around inf 98.5%
Taylor expanded in z around 0 91.5%
pow-base-191.5%
*-commutative91.5%
*-lft-identity91.5%
*-commutative91.5%
Simplified91.5%
Final simplification93.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (- z) y)))
(if (<= x -1.75e+146)
t_1
(if (<= x -5.8e-207)
t_2
(if (<= x -2.6e-226) (log t) (if (<= x 1.26e+150) 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 <= -1.75e+146) {
tmp = t_1;
} else if (x <= -5.8e-207) {
tmp = t_2;
} else if (x <= -2.6e-226) {
tmp = log(t);
} else if (x <= 1.26e+150) {
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 <= (-1.75d+146)) then
tmp = t_1
else if (x <= (-5.8d-207)) then
tmp = t_2
else if (x <= (-2.6d-226)) then
tmp = log(t)
else if (x <= 1.26d+150) 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 <= -1.75e+146) {
tmp = t_1;
} else if (x <= -5.8e-207) {
tmp = t_2;
} else if (x <= -2.6e-226) {
tmp = Math.log(t);
} else if (x <= 1.26e+150) {
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 <= -1.75e+146: tmp = t_1 elif x <= -5.8e-207: tmp = t_2 elif x <= -2.6e-226: tmp = math.log(t) elif x <= 1.26e+150: 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 <= -1.75e+146) tmp = t_1; elseif (x <= -5.8e-207) tmp = t_2; elseif (x <= -2.6e-226) tmp = log(t); elseif (x <= 1.26e+150) 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 <= -1.75e+146) tmp = t_1; elseif (x <= -5.8e-207) tmp = t_2; elseif (x <= -2.6e-226) tmp = log(t); elseif (x <= 1.26e+150) 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, -1.75e+146], t$95$1, If[LessEqual[x, -5.8e-207], t$95$2, If[LessEqual[x, -2.6e-226], N[Log[t], $MachinePrecision], If[LessEqual[x, 1.26e+150], 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 -1.75 \cdot 10^{+146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-207}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-226}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;x \leq 1.26 \cdot 10^{+150}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.7500000000000001e146 or 1.26e150 < x Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
associate--l+99.7%
add-cube-cbrt98.7%
associate-*r*98.7%
fma-def98.7%
pow298.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 98.7%
Taylor expanded in x around inf 75.2%
pow-base-175.2%
associate-*r*75.2%
*-lft-identity75.2%
Simplified75.2%
if -1.7500000000000001e146 < x < -5.80000000000000022e-207 or -2.5999999999999998e-226 < x < 1.26e150Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
associate--l+100.0%
add-cube-cbrt99.8%
associate-*r*99.8%
fma-def99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 86.7%
Taylor expanded in x around 0 75.5%
mul-1-neg75.5%
+-commutative75.5%
distribute-neg-in75.5%
sub-neg75.5%
Simplified75.5%
if -5.80000000000000022e-207 < x < -2.5999999999999998e-226Initial program 99.7%
+-commutative99.7%
add-log-exp99.7%
sum-log100.0%
associate--l-100.0%
exp-diff100.0%
*-commutative100.0%
exp-to-pow100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 86.9%
log-div86.9%
rem-log-exp86.9%
Simplified86.9%
Taylor expanded in y around 0 86.9%
Final simplification75.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (- z) y)))
(if (<= z -6900000000.0)
t_1
(if (<= z 4.2e-52)
(- (log t) y)
(if (<= z 1.25e+55) (* x (log y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = -z - y;
double tmp;
if (z <= -6900000000.0) {
tmp = t_1;
} else if (z <= 4.2e-52) {
tmp = log(t) - y;
} else if (z <= 1.25e+55) {
tmp = x * log(y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = -z - y
if (z <= (-6900000000.0d0)) then
tmp = t_1
else if (z <= 4.2d-52) then
tmp = log(t) - y
else if (z <= 1.25d+55) then
tmp = x * log(y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -z - y;
double tmp;
if (z <= -6900000000.0) {
tmp = t_1;
} else if (z <= 4.2e-52) {
tmp = Math.log(t) - y;
} else if (z <= 1.25e+55) {
tmp = x * Math.log(y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -z - y tmp = 0 if z <= -6900000000.0: tmp = t_1 elif z <= 4.2e-52: tmp = math.log(t) - y elif z <= 1.25e+55: tmp = x * math.log(y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-z) - y) tmp = 0.0 if (z <= -6900000000.0) tmp = t_1; elseif (z <= 4.2e-52) tmp = Float64(log(t) - y); elseif (z <= 1.25e+55) tmp = Float64(x * log(y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -z - y; tmp = 0.0; if (z <= -6900000000.0) tmp = t_1; elseif (z <= 4.2e-52) tmp = log(t) - y; elseif (z <= 1.25e+55) tmp = x * log(y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-z) - y), $MachinePrecision]}, If[LessEqual[z, -6900000000.0], t$95$1, If[LessEqual[z, 4.2e-52], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[z, 1.25e+55], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-z\right) - y\\
\mathbf{if}\;z \leq -6900000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-52}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+55}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -6.9e9 or 1.25000000000000011e55 < z Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
associate--l+100.0%
add-cube-cbrt99.8%
associate-*r*99.8%
fma-def99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.5%
Taylor expanded in x around 0 84.9%
mul-1-neg84.9%
+-commutative84.9%
distribute-neg-in84.9%
sub-neg84.9%
Simplified84.9%
if -6.9e9 < z < 4.1999999999999997e-52Initial program 99.9%
+-commutative99.9%
add-log-exp30.4%
sum-log30.5%
associate--l-30.5%
exp-diff29.4%
*-commutative29.4%
exp-to-pow29.4%
Applied egg-rr29.4%
Taylor expanded in x around 0 28.8%
Taylor expanded in z around 0 28.1%
log-div28.0%
rem-log-exp66.7%
Simplified66.7%
if 4.1999999999999997e-52 < z < 1.25000000000000011e55Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
add-cube-cbrt99.0%
associate-*r*98.9%
fma-def98.9%
pow298.9%
Applied egg-rr98.9%
Taylor expanded in z around inf 90.1%
Taylor expanded in x around inf 61.9%
pow-base-161.9%
associate-*r*61.9%
*-lft-identity61.9%
Simplified61.9%
Final simplification75.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.8e+146) (not (<= x 8.6e+145))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.8e+146) || !(x <= 8.6e+145)) {
tmp = x * log(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 <= (-5.8d+146)) .or. (.not. (x <= 8.6d+145))) then
tmp = x * log(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 <= -5.8e+146) || !(x <= 8.6e+145)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.8e+146) or not (x <= 8.6e+145): tmp = x * math.log(y) else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.8e+146) || !(x <= 8.6e+145)) tmp = Float64(x * log(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 <= -5.8e+146) || ~((x <= 8.6e+145))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.8e+146], N[Not[LessEqual[x, 8.6e+145]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+146} \lor \neg \left(x \leq 8.6 \cdot 10^{+145}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -5.7999999999999997e146 or 8.59999999999999996e145 < x Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
associate--l+99.7%
add-cube-cbrt98.7%
associate-*r*98.7%
fma-def98.7%
pow298.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 98.7%
Taylor expanded in x around inf 75.2%
pow-base-175.2%
associate-*r*75.2%
*-lft-identity75.2%
Simplified75.2%
if -5.7999999999999997e146 < x < 8.59999999999999996e145Initial program 99.9%
Taylor expanded in x around 0 88.4%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (<= y 1.5e+69) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5e+69) {
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 <= 1.5d+69) 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 <= 1.5e+69) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.5e+69: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.5e+69) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.5e+69) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.5e+69], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{+69}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.49999999999999992e69Initial program 99.9%
Taylor expanded in z around inf 45.8%
mul-1-neg45.8%
Simplified45.8%
if 1.49999999999999992e69 < y Initial program 100.0%
Taylor expanded in y around inf 64.5%
neg-mul-164.5%
Simplified64.5%
Final simplification52.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.9%
associate-+l-99.9%
sub-neg99.9%
associate--l+99.9%
add-cube-cbrt99.5%
associate-*r*99.5%
fma-def99.5%
pow299.5%
Applied egg-rr99.5%
Taylor expanded in z around inf 88.0%
Taylor expanded in x around 0 62.1%
mul-1-neg62.1%
+-commutative62.1%
distribute-neg-in62.1%
sub-neg62.1%
Simplified62.1%
Final simplification62.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.9%
Taylor expanded in y around inf 27.6%
neg-mul-127.6%
Simplified27.6%
Final simplification27.6%
herbie shell --seed 2023185
(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)))