
(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 10 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)) y) z))) (if (<= t_1 -40000000.0) (- y) (if (<= t_1 1e+28) (log t) (- z)))))
double code(double x, double y, double z, double t) {
double t_1 = ((x * log(y)) - y) - z;
double tmp;
if (t_1 <= -40000000.0) {
tmp = -y;
} else if (t_1 <= 1e+28) {
tmp = log(t);
} else {
tmp = -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)) - y) - z
if (t_1 <= (-40000000.0d0)) then
tmp = -y
else if (t_1 <= 1d+28) then
tmp = log(t)
else
tmp = -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)) - y) - z;
double tmp;
if (t_1 <= -40000000.0) {
tmp = -y;
} else if (t_1 <= 1e+28) {
tmp = Math.log(t);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x * math.log(y)) - y) - z tmp = 0 if t_1 <= -40000000.0: tmp = -y elif t_1 <= 1e+28: tmp = math.log(t) else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x * log(y)) - y) - z) tmp = 0.0 if (t_1 <= -40000000.0) tmp = Float64(-y); elseif (t_1 <= 1e+28) tmp = log(t); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x * log(y)) - y) - z; tmp = 0.0; if (t_1 <= -40000000.0) tmp = -y; elseif (t_1 <= 1e+28) tmp = log(t); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[t$95$1, -40000000.0], (-y), If[LessEqual[t$95$1, 1e+28], N[Log[t], $MachinePrecision], (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \log y - y\right) - z\\
\mathbf{if}\;t\_1 \leq -40000000:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_1 \leq 10^{+28}:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -4e7Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6449.0
Applied rewrites49.0%
if -4e7 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 9.99999999999999958e27Initial program 99.9%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites91.9%
Taylor expanded in z around 0
Applied rewrites91.1%
if 9.99999999999999958e27 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6443.6
Applied rewrites43.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -40000000.0)
(+ (log t) (- y))
(if (<= t_2 2e-16) (- (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 <= -40000000.0) {
tmp = log(t) + -y;
} else if (t_2 <= 2e-16) {
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 <= (-40000000.0d0)) then
tmp = log(t) + -y
else if (t_2 <= 2d-16) 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 <= -40000000.0) {
tmp = Math.log(t) + -y;
} else if (t_2 <= 2e-16) {
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 <= -40000000.0: tmp = math.log(t) + -y elif t_2 <= 2e-16: 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 <= -40000000.0) tmp = Float64(log(t) + Float64(-y)); elseif (t_2 <= 2e-16) 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 <= -40000000.0) tmp = log(t) + -y; elseif (t_2 <= 2e-16) 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, -40000000.0], N[(N[Log[t], $MachinePrecision] + (-y)), $MachinePrecision], If[LessEqual[t$95$2, 2e-16], 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 -40000000:\\
\;\;\;\;\log t + \left(-y\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-16}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -4e7Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6450.9
Applied rewrites50.9%
if -4e7 < (-.f64 (*.f64 x (log.f64 y)) y) < 2e-16Initial program 100.0%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites98.6%
if 2e-16 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6483.5
Applied rewrites83.5%
Final simplification69.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y))) (if (<= t_2 -2e+119) (- y) (if (<= t_2 2e-16) (- (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 <= -2e+119) {
tmp = -y;
} else if (t_2 <= 2e-16) {
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 <= (-2d+119)) then
tmp = -y
else if (t_2 <= 2d-16) 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 <= -2e+119) {
tmp = -y;
} else if (t_2 <= 2e-16) {
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 <= -2e+119: tmp = -y elif t_2 <= 2e-16: 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 <= -2e+119) tmp = Float64(-y); elseif (t_2 <= 2e-16) 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 <= -2e+119) tmp = -y; elseif (t_2 <= 2e-16) 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, -2e+119], (-y), If[LessEqual[t$95$2, 2e-16], 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 -2 \cdot 10^{+119}:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-16}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999989e119Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6454.3
Applied rewrites54.3%
if -1.99999999999999989e119 < (-.f64 (*.f64 x (log.f64 y)) y) < 2e-16Initial program 99.9%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f6483.6
Applied rewrites83.6%
Taylor expanded in x around 0
Applied rewrites75.6%
if 2e-16 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6483.5
Applied rewrites83.5%
(FPCore (x y z t) :precision binary64 (if (<= z -4.3e+21) (fma x (log y) (- z)) (if (<= z 2.3e+94) (- (fma x (log y) (log t)) y) (- (log t) (+ y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.3e+21) {
tmp = fma(x, log(y), -z);
} else if (z <= 2.3e+94) {
tmp = fma(x, log(y), log(t)) - y;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -4.3e+21) tmp = fma(x, log(y), Float64(-z)); elseif (z <= 2.3e+94) tmp = Float64(fma(x, log(y), log(t)) - y); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.3e+21], N[(x * N[Log[y], $MachinePrecision] + (-z)), $MachinePrecision], If[LessEqual[z, 2.3e+94], N[(N[(x * N[Log[y], $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, -z\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t\right) - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if z < -4.3e21Initial program 100.0%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f6485.5
Applied rewrites85.5%
Taylor expanded in z around inf
Applied rewrites85.5%
if -4.3e21 < z < 2.3e94Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6435.0
Applied rewrites35.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6497.6
Applied rewrites97.6%
if 2.3e94 < z Initial program 99.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6492.4
Applied rewrites92.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma x (log y) (- z)))) (if (<= x -1.65e+45) t_1 (if (<= x 5e+70) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(x, log(y), -z);
double tmp;
if (x <= -1.65e+45) {
tmp = t_1;
} else if (x <= 5e+70) {
tmp = log(t) - (y + z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(x, log(y), Float64(-z)) tmp = 0.0 if (x <= -1.65e+45) tmp = t_1; elseif (x <= 5e+70) 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] + (-z)), $MachinePrecision]}, If[LessEqual[x, -1.65e+45], t$95$1, If[LessEqual[x, 5e+70], 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, -z\right)\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+70}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.65e45 or 5.0000000000000002e70 < x Initial program 99.8%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f6485.0
Applied rewrites85.0%
Taylor expanded in z around inf
Applied rewrites85.0%
if -1.65e45 < x < 5.0000000000000002e70Initial program 100.0%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6495.2
Applied rewrites95.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= x -6e+46) t_1 (if (<= x 3.8e+121) (- (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 <= -6e+46) {
tmp = t_1;
} else if (x <= 3.8e+121) {
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 <= (-6d+46)) then
tmp = t_1
else if (x <= 3.8d+121) 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 <= -6e+46) {
tmp = t_1;
} else if (x <= 3.8e+121) {
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 <= -6e+46: tmp = t_1 elif x <= 3.8e+121: 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 <= -6e+46) tmp = t_1; elseif (x <= 3.8e+121) 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 <= -6e+46) tmp = t_1; elseif (x <= 3.8e+121) 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, -6e+46], t$95$1, If[LessEqual[x, 3.8e+121], 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 -6 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+121}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.00000000000000047e46 or 3.8e121 < x Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6471.5
Applied rewrites71.5%
if -6.00000000000000047e46 < x < 3.8e121Initial program 100.0%
Taylor expanded in x around 0
lower--.f64N/A
lower-log.f64N/A
lower-+.f6492.1
Applied rewrites92.1%
(FPCore (x y z t) :precision binary64 (if (<= y 40000000.0) (- (log t) z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 40000000.0) {
tmp = log(t) - 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 <= 40000000.0d0) then
tmp = log(t) - 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 <= 40000000.0) {
tmp = Math.log(t) - z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 40000000.0: tmp = math.log(t) - z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 40000000.0) tmp = Float64(log(t) - z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 40000000.0) tmp = log(t) - z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 40000000.0], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 40000000:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 4e7Initial program 99.9%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-log.f64N/A
unsub-negN/A
lower--.f64N/A
lower-log.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites58.8%
if 4e7 < y Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6453.7
Applied rewrites53.7%
(FPCore (x y z t) :precision binary64 (if (<= z -4.3e+21) (- z) (if (<= z 3.7e+83) (- y) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.3e+21) {
tmp = -z;
} else if (z <= 3.7e+83) {
tmp = -y;
} else {
tmp = -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 <= (-4.3d+21)) then
tmp = -z
else if (z <= 3.7d+83) then
tmp = -y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.3e+21) {
tmp = -z;
} else if (z <= 3.7e+83) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.3e+21: tmp = -z elif z <= 3.7e+83: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.3e+21) tmp = Float64(-z); elseif (z <= 3.7e+83) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.3e+21) tmp = -z; elseif (z <= 3.7e+83) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.3e+21], (-z), If[LessEqual[z, 3.7e+83], (-y), (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+21}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+83}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -4.3e21 or 3.7000000000000002e83 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6466.3
Applied rewrites66.3%
if -4.3e21 < z < 3.7000000000000002e83Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6435.8
Applied rewrites35.8%
(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
mul-1-negN/A
lower-neg.f6428.6
Applied rewrites28.6%
herbie shell --seed 2024233
(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)))