
(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) (- (- y) z)) (log t)))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (-y - z)) + log(t);
}
function code(x, y, z, t) return Float64(fma(x, log(y), Float64(Float64(-y) - z)) + log(t)) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[((-y) - z), $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \left(-y\right) - z\right) + \log t
\end{array}
Initial program 99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -5e+46)
(- t_1 (+ y z))
(if (<= t_2 4e-71) (- (log t) (+ y 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 <= -5e+46) {
tmp = t_1 - (y + z);
} else if (t_2 <= 4e-71) {
tmp = log(t) - (y + 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 <= (-5d+46)) then
tmp = t_1 - (y + z)
else if (t_2 <= 4d-71) then
tmp = log(t) - (y + 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 <= -5e+46) {
tmp = t_1 - (y + z);
} else if (t_2 <= 4e-71) {
tmp = Math.log(t) - (y + 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 <= -5e+46: tmp = t_1 - (y + z) elif t_2 <= 4e-71: tmp = math.log(t) - (y + 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 <= -5e+46) tmp = Float64(t_1 - Float64(y + z)); elseif (t_2 <= 4e-71) tmp = Float64(log(t) - Float64(y + 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 <= -5e+46) tmp = t_1 - (y + z); elseif (t_2 <= 4e-71) tmp = log(t) - (y + 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, -5e+46], N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e-71], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $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 -5 \cdot 10^{+46}:\\
\;\;\;\;t\_1 - \left(y + z\right)\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-71}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.0000000000000002e46Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
if -5.0000000000000002e46 < (-.f64 (*.f64 x (log.f64 y)) y) < 3.9999999999999997e-71Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around 0 99.0%
if 3.9999999999999997e-71 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in y around 0 99.7%
Final simplification99.6%
(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 (- (log t) y)) (t_2 (* x (log y))) (t_3 (- (- y) z)))
(if (<= x -1.05e+68)
t_2
(if (<= x -1.8e-281)
t_3
(if (<= x 1.5e-206)
t_1
(if (<= x 7e-123)
t_3
(if (<= x 8.5e-58) t_1 (if (<= x 1.7e+121) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double t_2 = x * log(y);
double t_3 = -y - z;
double tmp;
if (x <= -1.05e+68) {
tmp = t_2;
} else if (x <= -1.8e-281) {
tmp = t_3;
} else if (x <= 1.5e-206) {
tmp = t_1;
} else if (x <= 7e-123) {
tmp = t_3;
} else if (x <= 8.5e-58) {
tmp = t_1;
} else if (x <= 1.7e+121) {
tmp = t_3;
} else {
tmp = t_2;
}
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) :: t_3
real(8) :: tmp
t_1 = log(t) - y
t_2 = x * log(y)
t_3 = -y - z
if (x <= (-1.05d+68)) then
tmp = t_2
else if (x <= (-1.8d-281)) then
tmp = t_3
else if (x <= 1.5d-206) then
tmp = t_1
else if (x <= 7d-123) then
tmp = t_3
else if (x <= 8.5d-58) then
tmp = t_1
else if (x <= 1.7d+121) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - y;
double t_2 = x * Math.log(y);
double t_3 = -y - z;
double tmp;
if (x <= -1.05e+68) {
tmp = t_2;
} else if (x <= -1.8e-281) {
tmp = t_3;
} else if (x <= 1.5e-206) {
tmp = t_1;
} else if (x <= 7e-123) {
tmp = t_3;
} else if (x <= 8.5e-58) {
tmp = t_1;
} else if (x <= 1.7e+121) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - y t_2 = x * math.log(y) t_3 = -y - z tmp = 0 if x <= -1.05e+68: tmp = t_2 elif x <= -1.8e-281: tmp = t_3 elif x <= 1.5e-206: tmp = t_1 elif x <= 7e-123: tmp = t_3 elif x <= 8.5e-58: tmp = t_1 elif x <= 1.7e+121: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - y) t_2 = Float64(x * log(y)) t_3 = Float64(Float64(-y) - z) tmp = 0.0 if (x <= -1.05e+68) tmp = t_2; elseif (x <= -1.8e-281) tmp = t_3; elseif (x <= 1.5e-206) tmp = t_1; elseif (x <= 7e-123) tmp = t_3; elseif (x <= 8.5e-58) tmp = t_1; elseif (x <= 1.7e+121) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - y; t_2 = x * log(y); t_3 = -y - z; tmp = 0.0; if (x <= -1.05e+68) tmp = t_2; elseif (x <= -1.8e-281) tmp = t_3; elseif (x <= 1.5e-206) tmp = t_1; elseif (x <= 7e-123) tmp = t_3; elseif (x <= 8.5e-58) tmp = t_1; elseif (x <= 1.7e+121) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -1.05e+68], t$95$2, If[LessEqual[x, -1.8e-281], t$95$3, If[LessEqual[x, 1.5e-206], t$95$1, If[LessEqual[x, 7e-123], t$95$3, If[LessEqual[x, 8.5e-58], t$95$1, If[LessEqual[x, 1.7e+121], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
t_2 := x \cdot \log y\\
t_3 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-281}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-206}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-123}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+121}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -1.05e68 or 1.70000000000000005e121 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
add-cube-cbrt98.0%
pow397.9%
Applied egg-rr97.9%
Taylor expanded in x around inf 75.8%
if -1.05e68 < x < -1.80000000000000003e-281 or 1.5000000000000001e-206 < x < 6.9999999999999997e-123 or 8.5000000000000004e-58 < x < 1.70000000000000005e121Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in z around inf 87.7%
Taylor expanded in x around 0 80.3%
+-commutative80.3%
distribute-lft-in80.3%
neg-mul-180.3%
unsub-neg80.3%
mul-1-neg80.3%
Simplified80.3%
if -1.80000000000000003e-281 < x < 1.5000000000000001e-206 or 6.9999999999999997e-123 < x < 8.5000000000000004e-58Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around inf 86.3%
mul-1-neg86.3%
Simplified86.3%
Taylor expanded in y around 0 86.3%
neg-mul-186.3%
sub-neg86.3%
Simplified86.3%
Final simplification79.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 z)))
(if (<= x -2.15e+24)
t_2
(if (<= x 2.3e+49)
(- (log t) (+ y z))
(if (<= x 3.3e+182) t_2 (- 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 <= -2.15e+24) {
tmp = t_2;
} else if (x <= 2.3e+49) {
tmp = log(t) - (y + z);
} else if (x <= 3.3e+182) {
tmp = t_2;
} 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 <= (-2.15d+24)) then
tmp = t_2
else if (x <= 2.3d+49) then
tmp = log(t) - (y + z)
else if (x <= 3.3d+182) then
tmp = t_2
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 <= -2.15e+24) {
tmp = t_2;
} else if (x <= 2.3e+49) {
tmp = Math.log(t) - (y + z);
} else if (x <= 3.3e+182) {
tmp = t_2;
} 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 <= -2.15e+24: tmp = t_2 elif x <= 2.3e+49: tmp = math.log(t) - (y + z) elif x <= 3.3e+182: tmp = t_2 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 <= -2.15e+24) tmp = t_2; elseif (x <= 2.3e+49) tmp = Float64(log(t) - Float64(y + z)); elseif (x <= 3.3e+182) tmp = t_2; 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 <= -2.15e+24) tmp = t_2; elseif (x <= 2.3e+49) tmp = log(t) - (y + z); elseif (x <= 3.3e+182) tmp = t_2; 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, -2.15e+24], t$95$2, If[LessEqual[x, 2.3e+49], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+182], t$95$2, 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 -2.15 \cdot 10^{+24}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+49}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+182}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - y\\
\end{array}
\end{array}
if x < -2.14999999999999994e24 or 2.30000000000000002e49 < x < 3.3000000000000001e182Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in y around 0 90.9%
if -2.14999999999999994e24 < x < 2.30000000000000002e49Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 99.0%
if 3.3000000000000001e182 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in z around 0 93.0%
Final simplification95.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.05e+68) (not (<= x 8e+120))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.05e+68) || !(x <= 8e+120)) {
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 <= (-1.05d+68)) .or. (.not. (x <= 8d+120))) 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 <= -1.05e+68) || !(x <= 8e+120)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.05e+68) or not (x <= 8e+120): 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 <= -1.05e+68) || !(x <= 8e+120)) 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 <= -1.05e+68) || ~((x <= 8e+120))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.05e+68], N[Not[LessEqual[x, 8e+120]], $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 -1.05 \cdot 10^{+68} \lor \neg \left(x \leq 8 \cdot 10^{+120}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.05e68 or 7.9999999999999998e120 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
add-cube-cbrt98.0%
pow397.9%
Applied egg-rr97.9%
Taylor expanded in x around inf 75.8%
if -1.05e68 < x < 7.9999999999999998e120Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 93.9%
Final simplification87.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -9e+67) (not (<= x 1.05e+42))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9e+67) || !(x <= 1.05e+42)) {
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 <= (-9d+67)) .or. (.not. (x <= 1.05d+42))) 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 <= -9e+67) || !(x <= 1.05e+42)) {
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 <= -9e+67) or not (x <= 1.05e+42): 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 <= -9e+67) || !(x <= 1.05e+42)) 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 <= -9e+67) || ~((x <= 1.05e+42))) 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, -9e+67], N[Not[LessEqual[x, 1.05e+42]], $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 -9 \cdot 10^{+67} \lor \neg \left(x \leq 1.05 \cdot 10^{+42}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -8.9999999999999997e67 or 1.04999999999999998e42 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in z around 0 83.0%
if -8.9999999999999997e67 < x < 1.04999999999999998e42Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 98.3%
Final simplification91.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.05e+68) (not (<= x 1.25e+121))) (* x (log y)) (- (- y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.05e+68) || !(x <= 1.25e+121)) {
tmp = x * log(y);
} else {
tmp = -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 <= (-1.05d+68)) .or. (.not. (x <= 1.25d+121))) then
tmp = x * log(y)
else
tmp = -y - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.05e+68) || !(x <= 1.25e+121)) {
tmp = x * Math.log(y);
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.05e+68) or not (x <= 1.25e+121): tmp = x * math.log(y) else: tmp = -y - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.05e+68) || !(x <= 1.25e+121)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.05e+68) || ~((x <= 1.25e+121))) tmp = x * log(y); else tmp = -y - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.05e+68], N[Not[LessEqual[x, 1.25e+121]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-y) - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+68} \lor \neg \left(x \leq 1.25 \cdot 10^{+121}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if x < -1.05e68 or 1.25000000000000002e121 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
add-cube-cbrt98.0%
pow397.9%
Applied egg-rr97.9%
Taylor expanded in x around inf 75.8%
if -1.05e68 < x < 1.25000000000000002e121Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in z around inf 80.1%
Taylor expanded in x around 0 74.2%
+-commutative74.2%
distribute-lft-in74.2%
neg-mul-174.2%
unsub-neg74.2%
mul-1-neg74.2%
Simplified74.2%
Final simplification74.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.8e+71) (not (<= z 1.35e-9))) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.8e+71) || !(z <= 1.35e-9)) {
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 <= (-4.8d+71)) .or. (.not. (z <= 1.35d-9))) 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 <= -4.8e+71) || !(z <= 1.35e-9)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.8e+71) or not (z <= 1.35e-9): tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.8e+71) || !(z <= 1.35e-9)) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.8e+71) || ~((z <= 1.35e-9))) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.8e+71], N[Not[LessEqual[z, 1.35e-9]], $MachinePrecision]], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+71} \lor \neg \left(z \leq 1.35 \cdot 10^{-9}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -4.79999999999999961e71 or 1.3500000000000001e-9 < z Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
add-cube-cbrt99.5%
pow399.5%
Applied egg-rr99.5%
Taylor expanded in z around inf 63.1%
mul-1-neg63.1%
Simplified63.1%
if -4.79999999999999961e71 < z < 1.3500000000000001e-9Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
add-cube-cbrt99.2%
pow399.2%
Applied egg-rr99.2%
Taylor expanded in y around inf 39.1%
neg-mul-139.1%
Simplified39.1%
Final simplification49.6%
(FPCore (x y z t) :precision binary64 (- (- y) z))
double code(double x, double y, double z, double t) {
return -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 = -y - z
end function
public static double code(double x, double y, double z, double t) {
return -y - z;
}
def code(x, y, z, t): return -y - z
function code(x, y, z, t) return Float64(Float64(-y) - z) end
function tmp = code(x, y, z, t) tmp = -y - z; end
code[x_, y_, z_, t_] := N[((-y) - z), $MachinePrecision]
\begin{array}{l}
\\
\left(-y\right) - z
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 86.9%
Taylor expanded in x around 0 56.6%
+-commutative56.6%
distribute-lft-in56.6%
neg-mul-156.6%
unsub-neg56.6%
mul-1-neg56.6%
Simplified56.6%
Final simplification56.6%
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
return -y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -y
end function
public static double code(double x, double y, double z, double t) {
return -y;
}
def code(x, y, z, t): return -y
function code(x, y, z, t) return Float64(-y) end
function tmp = code(x, y, z, t) tmp = -y; end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
add-cube-cbrt99.4%
pow399.3%
Applied egg-rr99.3%
Taylor expanded in y around inf 29.0%
neg-mul-129.0%
Simplified29.0%
Final simplification29.0%
herbie shell --seed 2024059
(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)))