
(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 12 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) (- (- z) y)) (log t)))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (-z - y)) + log(t);
}
function code(x, y, z, t) return Float64(fma(x, log(y), Float64(Float64(-z) - y)) + log(t)) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[((-z) - y), $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \left(-z\right) - y\right) + \log t
\end{array}
Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)) (t_2 (- (- z) y)))
(if (<= t_1 -5e+169)
t_1
(if (<= t_1 -5e+129)
t_2
(if (<= t_1 -4e+88)
t_1
(if (<= t_1 -4e+15) t_2 (if (<= t_1 1e+44) (- (log t) z) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double t_2 = -z - y;
double tmp;
if (t_1 <= -5e+169) {
tmp = t_1;
} else if (t_1 <= -5e+129) {
tmp = t_2;
} else if (t_1 <= -4e+88) {
tmp = t_1;
} else if (t_1 <= -4e+15) {
tmp = t_2;
} else if (t_1 <= 1e+44) {
tmp = log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * log(y)) - y
t_2 = -z - y
if (t_1 <= (-5d+169)) then
tmp = t_1
else if (t_1 <= (-5d+129)) then
tmp = t_2
else if (t_1 <= (-4d+88)) then
tmp = t_1
else if (t_1 <= (-4d+15)) then
tmp = t_2
else if (t_1 <= 1d+44) 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 t_2 = -z - y;
double tmp;
if (t_1 <= -5e+169) {
tmp = t_1;
} else if (t_1 <= -5e+129) {
tmp = t_2;
} else if (t_1 <= -4e+88) {
tmp = t_1;
} else if (t_1 <= -4e+15) {
tmp = t_2;
} else if (t_1 <= 1e+44) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y t_2 = -z - y tmp = 0 if t_1 <= -5e+169: tmp = t_1 elif t_1 <= -5e+129: tmp = t_2 elif t_1 <= -4e+88: tmp = t_1 elif t_1 <= -4e+15: tmp = t_2 elif t_1 <= 1e+44: 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) t_2 = Float64(Float64(-z) - y) tmp = 0.0 if (t_1 <= -5e+169) tmp = t_1; elseif (t_1 <= -5e+129) tmp = t_2; elseif (t_1 <= -4e+88) tmp = t_1; elseif (t_1 <= -4e+15) tmp = t_2; elseif (t_1 <= 1e+44) 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; t_2 = -z - y; tmp = 0.0; if (t_1 <= -5e+169) tmp = t_1; elseif (t_1 <= -5e+129) tmp = t_2; elseif (t_1 <= -4e+88) tmp = t_1; elseif (t_1 <= -4e+15) tmp = t_2; elseif (t_1 <= 1e+44) 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]}, Block[{t$95$2 = N[((-z) - y), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+169], t$95$1, If[LessEqual[t$95$1, -5e+129], t$95$2, If[LessEqual[t$95$1, -4e+88], t$95$1, If[LessEqual[t$95$1, -4e+15], t$95$2, If[LessEqual[t$95$1, 1e+44], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
t_2 := \left(-z\right) - y\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+129}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+44}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.00000000000000017e169 or -5.0000000000000003e129 < (-.f64 (*.f64 x (log.f64 y)) y) < -3.99999999999999984e88 or 1.0000000000000001e44 < (-.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.8%
Taylor expanded in z around 0 88.3%
if -5.00000000000000017e169 < (-.f64 (*.f64 x (log.f64 y)) y) < -5.0000000000000003e129 or -3.99999999999999984e88 < (-.f64 (*.f64 x (log.f64 y)) y) < -4e15Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.6%
Taylor expanded in x around 0 76.7%
neg-mul-176.7%
neg-sub076.7%
+-commutative76.7%
associate--r+76.7%
neg-sub076.7%
Simplified76.7%
if -4e15 < (-.f64 (*.f64 x (log.f64 y)) y) < 1.0000000000000001e44Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 97.3%
neg-mul-197.3%
Simplified97.3%
Final simplification88.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)) (t_3 (- (- z) y)))
(if (<= t_2 -5e+169)
t_2
(if (<= t_2 -5e+129)
t_3
(if (<= t_2 -4e+88)
t_2
(if (<= t_2 -4e+15)
t_3
(if (<= t_2 1e-27) (- (log t) z) (- t_1 z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double t_3 = -z - y;
double tmp;
if (t_2 <= -5e+169) {
tmp = t_2;
} else if (t_2 <= -5e+129) {
tmp = t_3;
} else if (t_2 <= -4e+88) {
tmp = t_2;
} else if (t_2 <= -4e+15) {
tmp = t_3;
} else if (t_2 <= 1e-27) {
tmp = log(t) - z;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
t_3 = -z - y
if (t_2 <= (-5d+169)) then
tmp = t_2
else if (t_2 <= (-5d+129)) then
tmp = t_3
else if (t_2 <= (-4d+88)) then
tmp = t_2
else if (t_2 <= (-4d+15)) then
tmp = t_3
else if (t_2 <= 1d-27) then
tmp = log(t) - z
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double t_3 = -z - y;
double tmp;
if (t_2 <= -5e+169) {
tmp = t_2;
} else if (t_2 <= -5e+129) {
tmp = t_3;
} else if (t_2 <= -4e+88) {
tmp = t_2;
} else if (t_2 <= -4e+15) {
tmp = t_3;
} else if (t_2 <= 1e-27) {
tmp = Math.log(t) - z;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y t_3 = -z - y tmp = 0 if t_2 <= -5e+169: tmp = t_2 elif t_2 <= -5e+129: tmp = t_3 elif t_2 <= -4e+88: tmp = t_2 elif t_2 <= -4e+15: tmp = t_3 elif t_2 <= 1e-27: tmp = math.log(t) - z else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) t_3 = Float64(Float64(-z) - y) tmp = 0.0 if (t_2 <= -5e+169) tmp = t_2; elseif (t_2 <= -5e+129) tmp = t_3; elseif (t_2 <= -4e+88) tmp = t_2; elseif (t_2 <= -4e+15) tmp = t_3; elseif (t_2 <= 1e-27) tmp = Float64(log(t) - z); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; t_3 = -z - y; tmp = 0.0; if (t_2 <= -5e+169) tmp = t_2; elseif (t_2 <= -5e+129) tmp = t_3; elseif (t_2 <= -4e+88) tmp = t_2; elseif (t_2 <= -4e+15) tmp = t_3; elseif (t_2 <= 1e-27) tmp = log(t) - z; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, Block[{t$95$3 = N[((-z) - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+169], t$95$2, If[LessEqual[t$95$2, -5e+129], t$95$3, If[LessEqual[t$95$2, -4e+88], t$95$2, If[LessEqual[t$95$2, -4e+15], t$95$3, If[LessEqual[t$95$2, 1e-27], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
t_3 := \left(-z\right) - y\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+169}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+129}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{+88}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{+15}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{-27}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.00000000000000017e169 or -5.0000000000000003e129 < (-.f64 (*.f64 x (log.f64 y)) y) < -3.99999999999999984e88Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in z around 0 89.4%
if -5.00000000000000017e169 < (-.f64 (*.f64 x (log.f64 y)) y) < -5.0000000000000003e129 or -3.99999999999999984e88 < (-.f64 (*.f64 x (log.f64 y)) y) < -4e15Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.6%
Taylor expanded in x around 0 76.7%
neg-mul-176.7%
neg-sub076.7%
+-commutative76.7%
associate--r+76.7%
neg-sub076.7%
Simplified76.7%
if -4e15 < (-.f64 (*.f64 x (log.f64 y)) y) < 1e-27Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 98.7%
neg-mul-198.7%
Simplified98.7%
if 1e-27 < (-.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.8%
Taylor expanded in y around 0 99.8%
Final simplification90.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -2e+26)
(- t_1 (+ y z))
(if (<= t_2 1e-27) (- (- (log t) z) y) (- 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 <= -2e+26) {
tmp = t_1 - (y + z);
} else if (t_2 <= 1e-27) {
tmp = (log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-2d+26)) then
tmp = t_1 - (y + z)
else if (t_2 <= 1d-27) then
tmp = (log(t) - z) - y
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+26) {
tmp = t_1 - (y + z);
} else if (t_2 <= 1e-27) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -2e+26: tmp = t_1 - (y + z) elif t_2 <= 1e-27: tmp = (math.log(t) - z) - y else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -2e+26) tmp = Float64(t_1 - Float64(y + z)); elseif (t_2 <= 1e-27) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -2e+26) tmp = t_1 - (y + z); elseif (t_2 <= 1e-27) tmp = (log(t) - z) - y; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+26], N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-27], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+26}:\\
\;\;\;\;t\_1 - \left(y + z\right)\\
\mathbf{elif}\;t\_2 \leq 10^{-27}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2.0000000000000001e26Initial program 99.8%
associate-+l-99.8%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
if -2.0000000000000001e26 < (-.f64 (*.f64 x (log.f64 y)) y) < 1e-27Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
unsub-neg100.0%
fma-undefine100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 99.2%
if 1e-27 < (-.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.8%
Taylor expanded in y around 0 99.8%
Final simplification99.7%
(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.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (+ (* x (log y)) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
return (x * log(y)) + ((log(t) - 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 = (x * log(y)) + ((log(t) - z) - y)
end function
public static double code(double x, double y, double z, double t) {
return (x * Math.log(y)) + ((Math.log(t) - z) - y);
}
def code(x, y, z, t): return (x * math.log(y)) + ((math.log(t) - z) - y)
function code(x, y, z, t) return Float64(Float64(x * log(y)) + Float64(Float64(log(t) - z) - y)) end
function tmp = code(x, y, z, t) tmp = (x * log(y)) + ((log(t) - z) - y); end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \log y + \left(\left(\log t - z\right) - y\right)
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -9.8e+51)
(- t_1 y)
(if (<= x 2.1e+23) (- (- (log t) z) y) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -9.8e+51) {
tmp = t_1 - y;
} else if (x <= 2.1e+23) {
tmp = (log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-9.8d+51)) then
tmp = t_1 - y
else if (x <= 2.1d+23) then
tmp = (log(t) - z) - y
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if (x <= -9.8e+51) {
tmp = t_1 - y;
} else if (x <= 2.1e+23) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -9.8e+51: tmp = t_1 - y elif x <= 2.1e+23: tmp = (math.log(t) - z) - y else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -9.8e+51) tmp = Float64(t_1 - y); elseif (x <= 2.1e+23) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -9.8e+51) tmp = t_1 - y; elseif (x <= 2.1e+23) tmp = (log(t) - z) - y; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.8e+51], N[(t$95$1 - y), $MachinePrecision], If[LessEqual[x, 2.1e+23], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -9.8 \cdot 10^{+51}:\\
\;\;\;\;t\_1 - y\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+23}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if x < -9.79999999999999967e51Initial 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 87.0%
if -9.79999999999999967e51 < x < 2.1000000000000001e23Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
unsub-neg100.0%
fma-undefine100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 99.0%
if 2.1000000000000001e23 < 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 y around 0 82.2%
Final simplification92.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.4e+21) (not (<= z 3.6e-41))) (- (- z) y) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.4e+21) || !(z <= 3.6e-41)) {
tmp = -z - y;
} else {
tmp = log(t) - 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 <= (-5.4d+21)) .or. (.not. (z <= 3.6d-41))) then
tmp = -z - y
else
tmp = log(t) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.4e+21) || !(z <= 3.6e-41)) {
tmp = -z - y;
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.4e+21) or not (z <= 3.6e-41): tmp = -z - y else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.4e+21) || !(z <= 3.6e-41)) tmp = Float64(Float64(-z) - y); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.4e+21) || ~((z <= 3.6e-41))) tmp = -z - y; else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.4e+21], N[Not[LessEqual[z, 3.6e-41]], $MachinePrecision]], N[((-z) - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+21} \lor \neg \left(z \leq 3.6 \cdot 10^{-41}\right):\\
\;\;\;\;\left(-z\right) - y\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if z < -5.4e21 or 3.6e-41 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in x around 0 78.7%
neg-mul-178.7%
neg-sub078.7%
+-commutative78.7%
associate--r+78.7%
neg-sub078.7%
Simplified78.7%
if -5.4e21 < z < 3.6e-41Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 62.8%
mul-1-neg62.8%
Simplified62.8%
Final simplification70.2%
(FPCore (x y z t) :precision binary64 (if (<= y 6100000.0) (- (log t) z) (- (- z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6100000.0) {
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 <= 6100000.0d0) 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 <= 6100000.0) {
tmp = Math.log(t) - z;
} else {
tmp = -z - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 6100000.0: tmp = math.log(t) - z else: tmp = -z - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 6100000.0) 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 <= 6100000.0) tmp = log(t) - z; else tmp = -z - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 6100000.0], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[((-z) - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6100000:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - y\\
\end{array}
\end{array}
if y < 6.1e6Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 62.3%
neg-mul-162.3%
Simplified62.3%
if 6.1e6 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around 0 78.2%
neg-mul-178.2%
neg-sub078.2%
+-commutative78.2%
associate--r+78.2%
neg-sub078.2%
Simplified78.2%
Final simplification70.3%
(FPCore (x y z t) :precision binary64 (if (<= y 2.65e+57) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.65e+57) {
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 <= 2.65d+57) 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 <= 2.65e+57) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.65e+57: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.65e+57) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.65e+57) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.65e+57], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.65 \cdot 10^{+57}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.64999999999999993e57Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 76.5%
Taylor expanded in z around inf 35.7%
neg-mul-135.7%
Simplified35.7%
if 2.64999999999999993e57 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in y around inf 65.2%
mul-1-neg65.2%
Simplified65.2%
Final simplification48.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.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 86.7%
Taylor expanded in x around 0 57.5%
neg-mul-157.5%
neg-sub057.5%
+-commutative57.5%
associate--r+57.5%
neg-sub057.5%
Simplified57.5%
Final simplification57.5%
(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%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 86.7%
Taylor expanded in y around inf 30.8%
mul-1-neg30.8%
Simplified30.8%
Final simplification30.8%
herbie shell --seed 2024078
(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)))