
(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 (+ (- (- (* 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%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y))) (if (<= t_2 -5e+78) (- 0.0 y) (if (<= t_2 100.0) (- (log t) z) t_1))))
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+78) {
tmp = 0.0 - y;
} else if (t_2 <= 100.0) {
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)
t_2 = t_1 - y
if (t_2 <= (-5d+78)) then
tmp = 0.0d0 - y
else if (t_2 <= 100.0d0) 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);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -5e+78) {
tmp = 0.0 - y;
} else if (t_2 <= 100.0) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
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+78: tmp = 0.0 - y elif t_2 <= 100.0: tmp = math.log(t) - z else: tmp = t_1 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+78) tmp = Float64(0.0 - y); elseif (t_2 <= 100.0) 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); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -5e+78) tmp = 0.0 - y; elseif (t_2 <= 100.0) tmp = log(t) - z; 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[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+78], N[(0.0 - y), $MachinePrecision], If[LessEqual[t$95$2, 100.0], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\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^{+78}:\\
\;\;\;\;0 - y\\
\mathbf{elif}\;t\_2 \leq 100:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -4.99999999999999984e78Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6458.0
Simplified58.0%
sub0-negN/A
neg-lowering-neg.f6458.0
Applied egg-rr58.0%
if -4.99999999999999984e78 < (-.f64 (*.f64 x (log.f64 y)) y) < 100Initial program 100.0%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6490.2
Simplified90.2%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f6484.2
Simplified84.2%
if 100 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.5%
flip--N/A
div-invN/A
difference-of-squaresN/A
associate-*l*N/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
sub-negN/A
neg-sub0N/A
associate-+r-N/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f6496.9
Applied egg-rr96.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6481.3
Simplified81.3%
Final simplification71.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) (+ y z))))
(if (<= z -5e+27)
t_1
(if (<= z 2.4e+58) (fma x (log y) (- (log t) y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - (y + z);
double tmp;
if (z <= -5e+27) {
tmp = t_1;
} else if (z <= 2.4e+58) {
tmp = fma(x, log(y), (log(t) - y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(t) - Float64(y + z)) tmp = 0.0 if (z <= -5e+27) tmp = t_1; elseif (z <= 2.4e+58) tmp = fma(x, log(y), Float64(log(t) - y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+27], t$95$1, If[LessEqual[z, 2.4e+58], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - \left(y + z\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.99999999999999979e27 or 2.4e58 < z Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6487.4
Simplified87.4%
if -4.99999999999999979e27 < z < 2.4e58Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
log-lowering-log.f6497.4
Simplified97.4%
(FPCore (x y z t) :precision binary64 (if (<= y 5.4e+85) (+ (log t) (fma x (log y) (- 0.0 z))) (fma x (log y) (- (log t) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.4e+85) {
tmp = log(t) + fma(x, log(y), (0.0 - z));
} else {
tmp = fma(x, log(y), (log(t) - y));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 5.4e+85) tmp = Float64(log(t) + fma(x, log(y), Float64(0.0 - z))); else tmp = fma(x, log(y), Float64(log(t) - y)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 5.4e+85], N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision] + N[(0.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.4 \cdot 10^{+85}:\\
\;\;\;\;\log t + \mathsf{fma}\left(x, \log y, 0 - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - y\right)\\
\end{array}
\end{array}
if y < 5.39999999999999966e85Initial program 99.8%
Taylor expanded in y around 0
sub-negN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
--lowering--.f6493.5
Simplified93.5%
if 5.39999999999999966e85 < y Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
log-lowering-log.f6489.9
Simplified89.9%
Final simplification92.2%
(FPCore (x y z t) :precision binary64 (if (<= y 3.3e+85) (fma x (log y) (- (log t) z)) (fma x (log y) (- (log t) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e+85) {
tmp = fma(x, log(y), (log(t) - z));
} else {
tmp = fma(x, log(y), (log(t) - y));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e+85) tmp = fma(x, log(y), Float64(log(t) - z)); else tmp = fma(x, log(y), Float64(log(t) - y)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e+85], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - y\right)\\
\end{array}
\end{array}
if y < 3.2999999999999999e85Initial program 99.8%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6493.4
Simplified93.4%
if 3.2999999999999999e85 < y Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
log-lowering-log.f6489.9
Simplified89.9%
(FPCore (x y z t) :precision binary64 (if (<= x -9e+64) (fma x (log y) (- 0.0 y)) (if (<= x 1.15e+83) (- (log t) (+ y z)) (fma x (log y) (- 0.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9e+64) {
tmp = fma(x, log(y), (0.0 - y));
} else if (x <= 1.15e+83) {
tmp = log(t) - (y + z);
} else {
tmp = fma(x, log(y), (0.0 - z));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -9e+64) tmp = fma(x, log(y), Float64(0.0 - y)); elseif (x <= 1.15e+83) tmp = Float64(log(t) - Float64(y + z)); else tmp = fma(x, log(y), Float64(0.0 - z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -9e+64], N[(x * N[Log[y], $MachinePrecision] + N[(0.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e+83], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(x * N[Log[y], $MachinePrecision] + N[(0.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, 0 - y\right)\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+83}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, 0 - z\right)\\
\end{array}
\end{array}
if x < -8.99999999999999946e64Initial program 99.7%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
log-lowering-log.f6487.9
Simplified87.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6487.9
Simplified87.9%
if -8.99999999999999946e64 < x < 1.14999999999999997e83Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6494.3
Simplified94.3%
if 1.14999999999999997e83 < x Initial program 99.7%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6486.1
Simplified86.1%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6486.1
Simplified86.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma x (log y) (- 0.0 y)))) (if (<= x -9e+63) t_1 (if (<= x 2.2e+44) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(x, log(y), (0.0 - y));
double tmp;
if (x <= -9e+63) {
tmp = t_1;
} else if (x <= 2.2e+44) {
tmp = log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(x, log(y), Float64(0.0 - y)) tmp = 0.0 if (x <= -9e+63) tmp = t_1; elseif (x <= 2.2e+44) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision] + N[(0.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e+63], t$95$1, If[LessEqual[x, 2.2e+44], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \log y, 0 - y\right)\\
\mathbf{if}\;x \leq -9 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+44}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.00000000000000034e63 or 2.19999999999999996e44 < x Initial program 99.7%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
log-lowering-log.f6484.9
Simplified84.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6484.9
Simplified84.9%
if -9.00000000000000034e63 < x < 2.19999999999999996e44Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6495.2
Simplified95.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= x -1.4e+65) t_1 (if (<= x 5.2e+97) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.4e+65) {
tmp = t_1;
} else if (x <= 5.2e+97) {
tmp = log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-1.4d+65)) then
tmp = t_1
else if (x <= 5.2d+97) then
tmp = log(t) - (y + 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);
double tmp;
if (x <= -1.4e+65) {
tmp = t_1;
} else if (x <= 5.2e+97) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.4e+65: tmp = t_1 elif x <= 5.2e+97: tmp = math.log(t) - (y + z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.4e+65) tmp = t_1; elseif (x <= 5.2e+97) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -1.4e+65) tmp = t_1; elseif (x <= 5.2e+97) tmp = log(t) - (y + z); 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]}, If[LessEqual[x, -1.4e+65], t$95$1, If[LessEqual[x, 5.2e+97], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+97}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.3999999999999999e65 or 5.2e97 < x Initial program 99.7%
flip--N/A
div-invN/A
difference-of-squaresN/A
associate-*l*N/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
sub-negN/A
neg-sub0N/A
associate-+r-N/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f6498.4
Applied egg-rr98.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6468.6
Simplified68.6%
if -1.3999999999999999e65 < x < 5.2e97Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6492.7
Simplified92.7%
(FPCore (x y z t) :precision binary64 (if (<= z -6.3e+126) (- 0.0 z) (if (<= z 3.5e+68) (- (log t) y) (- 0.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.3e+126) {
tmp = 0.0 - z;
} else if (z <= 3.5e+68) {
tmp = log(t) - y;
} else {
tmp = 0.0 - 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 (z <= (-6.3d+126)) then
tmp = 0.0d0 - z
else if (z <= 3.5d+68) then
tmp = log(t) - y
else
tmp = 0.0d0 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.3e+126) {
tmp = 0.0 - z;
} else if (z <= 3.5e+68) {
tmp = Math.log(t) - y;
} else {
tmp = 0.0 - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.3e+126: tmp = 0.0 - z elif z <= 3.5e+68: tmp = math.log(t) - y else: tmp = 0.0 - z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.3e+126) tmp = Float64(0.0 - z); elseif (z <= 3.5e+68) tmp = Float64(log(t) - y); else tmp = Float64(0.0 - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.3e+126) tmp = 0.0 - z; elseif (z <= 3.5e+68) tmp = log(t) - y; else tmp = 0.0 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.3e+126], N[(0.0 - z), $MachinePrecision], If[LessEqual[z, 3.5e+68], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], N[(0.0 - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.3 \cdot 10^{+126}:\\
\;\;\;\;0 - z\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+68}:\\
\;\;\;\;\log t - y\\
\mathbf{else}:\\
\;\;\;\;0 - z\\
\end{array}
\end{array}
if z < -6.29999999999999975e126 or 3.49999999999999977e68 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6474.4
Simplified74.4%
sub0-negN/A
neg-lowering-neg.f6474.4
Applied egg-rr74.4%
if -6.29999999999999975e126 < z < 3.49999999999999977e68Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
--lowering--.f64N/A
log-lowering-log.f6494.2
Simplified94.2%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f6460.4
Simplified60.4%
Final simplification64.7%
(FPCore (x y z t) :precision binary64 (if (<= y 3.3e+88) (- (log t) z) (- 0.0 y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e+88) {
tmp = log(t) - z;
} else {
tmp = 0.0 - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 3.3d+88) then
tmp = log(t) - z
else
tmp = 0.0d0 - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e+88) {
tmp = Math.log(t) - z;
} else {
tmp = 0.0 - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.3e+88: tmp = math.log(t) - z else: tmp = 0.0 - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e+88) tmp = Float64(log(t) - z); else tmp = Float64(0.0 - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.3e+88) tmp = log(t) - z; else tmp = 0.0 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e+88], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[(0.0 - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{+88}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;0 - y\\
\end{array}
\end{array}
if y < 3.3000000000000003e88Initial program 99.8%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
unsub-negN/A
--lowering--.f64N/A
log-lowering-log.f6493.5
Simplified93.5%
Taylor expanded in x around 0
--lowering--.f64N/A
log-lowering-log.f6459.3
Simplified59.3%
if 3.3000000000000003e88 < y Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6476.0
Simplified76.0%
sub0-negN/A
neg-lowering-neg.f6476.0
Applied egg-rr76.0%
Final simplification65.0%
(FPCore (x y z t) :precision binary64 (if (<= y 3.3e+88) (- 0.0 z) (- 0.0 y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e+88) {
tmp = 0.0 - z;
} else {
tmp = 0.0 - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 3.3d+88) then
tmp = 0.0d0 - z
else
tmp = 0.0d0 - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e+88) {
tmp = 0.0 - z;
} else {
tmp = 0.0 - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.3e+88: tmp = 0.0 - z else: tmp = 0.0 - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e+88) tmp = Float64(0.0 - z); else tmp = Float64(0.0 - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.3e+88) tmp = 0.0 - z; else tmp = 0.0 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e+88], N[(0.0 - z), $MachinePrecision], N[(0.0 - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{+88}:\\
\;\;\;\;0 - z\\
\mathbf{else}:\\
\;\;\;\;0 - y\\
\end{array}
\end{array}
if y < 3.3000000000000003e88Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6436.2
Simplified36.2%
sub0-negN/A
neg-lowering-neg.f6436.2
Applied egg-rr36.2%
if 3.3000000000000003e88 < y Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6476.0
Simplified76.0%
sub0-negN/A
neg-lowering-neg.f6476.0
Applied egg-rr76.0%
Final simplification49.9%
(FPCore (x y z t) :precision binary64 (- 0.0 y))
double code(double x, double y, double z, double t) {
return 0.0 - 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 = 0.0d0 - y
end function
public static double code(double x, double y, double z, double t) {
return 0.0 - y;
}
def code(x, y, z, t): return 0.0 - y
function code(x, y, z, t) return Float64(0.0 - y) end
function tmp = code(x, y, z, t) tmp = 0.0 - y; end
code[x_, y_, z_, t_] := N[(0.0 - y), $MachinePrecision]
\begin{array}{l}
\\
0 - y
\end{array}
Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6431.5
Simplified31.5%
sub0-negN/A
neg-lowering-neg.f6431.5
Applied egg-rr31.5%
Final simplification31.5%
herbie shell --seed 2024195
(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)))