
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - 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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - 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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (/ x_m (* (- y z) (- t z))))) (* x_s (if (<= t_1 -4e-323) t_1 (/ (/ x_m (- t z)) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / ((y - z) * (t - z));
double tmp;
if (t_1 <= -4e-323) {
tmp = t_1;
} else {
tmp = (x_m / (t - z)) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
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_m / ((y - z) * (t - z))
if (t_1 <= (-4d-323)) then
tmp = t_1
else
tmp = (x_m / (t - z)) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / ((y - z) * (t - z));
double tmp;
if (t_1 <= -4e-323) {
tmp = t_1;
} else {
tmp = (x_m / (t - z)) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / ((y - z) * (t - z)) tmp = 0 if t_1 <= -4e-323: tmp = t_1 else: tmp = (x_m / (t - z)) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= -4e-323) tmp = t_1; else tmp = Float64(Float64(x_m / Float64(t - z)) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / ((y - z) * (t - z));
tmp = 0.0;
if (t_1 <= -4e-323)
tmp = t_1;
else
tmp = (x_m / (t - z)) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -4e-323], t$95$1, N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-323}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\end{array}
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -3.95253e-323Initial program 99.8%
if -3.95253e-323 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 90.0%
associate-/l/98.1%
Simplified98.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m y) t)))
(*
x_s
(if (<= y -1.12e+266)
(/ (/ x_m z) (- y))
(if (<= y -7.5e+172)
t_1
(if (<= y -1e+37)
(/ x_m (* z (- y)))
(if (<= y 7e-51) (/ x_m (* z (- z t))) t_1)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / y) / t;
double tmp;
if (y <= -1.12e+266) {
tmp = (x_m / z) / -y;
} else if (y <= -7.5e+172) {
tmp = t_1;
} else if (y <= -1e+37) {
tmp = x_m / (z * -y);
} else if (y <= 7e-51) {
tmp = x_m / (z * (z - t));
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
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_m / y) / t
if (y <= (-1.12d+266)) then
tmp = (x_m / z) / -y
else if (y <= (-7.5d+172)) then
tmp = t_1
else if (y <= (-1d+37)) then
tmp = x_m / (z * -y)
else if (y <= 7d-51) then
tmp = x_m / (z * (z - t))
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / y) / t;
double tmp;
if (y <= -1.12e+266) {
tmp = (x_m / z) / -y;
} else if (y <= -7.5e+172) {
tmp = t_1;
} else if (y <= -1e+37) {
tmp = x_m / (z * -y);
} else if (y <= 7e-51) {
tmp = x_m / (z * (z - t));
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = (x_m / y) / t tmp = 0 if y <= -1.12e+266: tmp = (x_m / z) / -y elif y <= -7.5e+172: tmp = t_1 elif y <= -1e+37: tmp = x_m / (z * -y) elif y <= 7e-51: tmp = x_m / (z * (z - t)) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / y) / t) tmp = 0.0 if (y <= -1.12e+266) tmp = Float64(Float64(x_m / z) / Float64(-y)); elseif (y <= -7.5e+172) tmp = t_1; elseif (y <= -1e+37) tmp = Float64(x_m / Float64(z * Float64(-y))); elseif (y <= 7e-51) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = (x_m / y) / t;
tmp = 0.0;
if (y <= -1.12e+266)
tmp = (x_m / z) / -y;
elseif (y <= -7.5e+172)
tmp = t_1;
elseif (y <= -1e+37)
tmp = x_m / (z * -y);
elseif (y <= 7e-51)
tmp = x_m / (z * (z - t));
else
tmp = t_1;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -1.12e+266], N[(N[(x$95$m / z), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[y, -7.5e+172], t$95$1, If[LessEqual[y, -1e+37], N[(x$95$m / N[(z * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-51], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{y}}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+266}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{-y}\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{+37}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-y\right)}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-51}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -1.11999999999999996e266Initial program 100.0%
Taylor expanded in t around 0 83.4%
mul-1-neg83.4%
associate-/r*83.0%
distribute-neg-frac283.0%
neg-sub083.0%
sub-neg83.0%
+-commutative83.0%
associate--r+83.0%
neg-sub083.0%
remove-double-neg83.0%
Simplified83.0%
Taylor expanded in z around 0 83.0%
neg-mul-183.0%
Simplified83.0%
if -1.11999999999999996e266 < y < -7.4999999999999994e172 or 6.9999999999999995e-51 < y Initial program 89.8%
Taylor expanded in y around inf 78.9%
associate-/r*81.9%
Simplified81.9%
Taylor expanded in t around inf 56.0%
if -7.4999999999999994e172 < y < -9.99999999999999954e36Initial program 90.9%
Taylor expanded in y around inf 83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in t around 0 42.6%
associate-*r/42.6%
neg-mul-142.6%
*-commutative42.6%
Simplified42.6%
if -9.99999999999999954e36 < y < 6.9999999999999995e-51Initial program 94.4%
Taylor expanded in y around 0 76.8%
mul-1-neg76.8%
distribute-rgt-neg-in76.8%
sub-neg76.8%
+-commutative76.8%
distribute-neg-in76.8%
remove-double-neg76.8%
unsub-neg76.8%
Simplified76.8%
Final simplification67.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (/ x_m y) t)))
(*
x_s
(if (<= t -1.18e+27)
t_1
(if (<= t 5.2e-27)
(/ x_m (* z (- z y)))
(if (<= t 6.6e+136)
(/ x_m (* z (- z t)))
(if (<= t 4.6e+154) t_1 (/ (/ x_m t) (- z)))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / y) / t;
double tmp;
if (t <= -1.18e+27) {
tmp = t_1;
} else if (t <= 5.2e-27) {
tmp = x_m / (z * (z - y));
} else if (t <= 6.6e+136) {
tmp = x_m / (z * (z - t));
} else if (t <= 4.6e+154) {
tmp = t_1;
} else {
tmp = (x_m / t) / -z;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
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_m / y) / t
if (t <= (-1.18d+27)) then
tmp = t_1
else if (t <= 5.2d-27) then
tmp = x_m / (z * (z - y))
else if (t <= 6.6d+136) then
tmp = x_m / (z * (z - t))
else if (t <= 4.6d+154) then
tmp = t_1
else
tmp = (x_m / t) / -z
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / y) / t;
double tmp;
if (t <= -1.18e+27) {
tmp = t_1;
} else if (t <= 5.2e-27) {
tmp = x_m / (z * (z - y));
} else if (t <= 6.6e+136) {
tmp = x_m / (z * (z - t));
} else if (t <= 4.6e+154) {
tmp = t_1;
} else {
tmp = (x_m / t) / -z;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = (x_m / y) / t tmp = 0 if t <= -1.18e+27: tmp = t_1 elif t <= 5.2e-27: tmp = x_m / (z * (z - y)) elif t <= 6.6e+136: tmp = x_m / (z * (z - t)) elif t <= 4.6e+154: tmp = t_1 else: tmp = (x_m / t) / -z return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / y) / t) tmp = 0.0 if (t <= -1.18e+27) tmp = t_1; elseif (t <= 5.2e-27) tmp = Float64(x_m / Float64(z * Float64(z - y))); elseif (t <= 6.6e+136) tmp = Float64(x_m / Float64(z * Float64(z - t))); elseif (t <= 4.6e+154) tmp = t_1; else tmp = Float64(Float64(x_m / t) / Float64(-z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = (x_m / y) / t;
tmp = 0.0;
if (t <= -1.18e+27)
tmp = t_1;
elseif (t <= 5.2e-27)
tmp = x_m / (z * (z - y));
elseif (t <= 6.6e+136)
tmp = x_m / (z * (z - t));
elseif (t <= 4.6e+154)
tmp = t_1;
else
tmp = (x_m / t) / -z;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -1.18e+27], t$95$1, If[LessEqual[t, 5.2e-27], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e+136], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+154], t$95$1, N[(N[(x$95$m / t), $MachinePrecision] / (-z)), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{y}}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.18 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-27}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+136}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{-z}\\
\end{array}
\end{array}
\end{array}
if t < -1.18000000000000006e27 or 6.59999999999999984e136 < t < 4.6e154Initial program 94.4%
Taylor expanded in y around inf 52.8%
associate-/r*52.5%
Simplified52.5%
Taylor expanded in t around inf 48.5%
if -1.18000000000000006e27 < t < 5.20000000000000034e-27Initial program 95.6%
Taylor expanded in t around 0 78.3%
mul-1-neg78.3%
distribute-rgt-neg-in78.3%
neg-sub078.3%
sub-neg78.3%
+-commutative78.3%
associate--r+78.3%
neg-sub078.3%
remove-double-neg78.3%
Simplified78.3%
if 5.20000000000000034e-27 < t < 6.59999999999999984e136Initial program 92.0%
Taylor expanded in y around 0 49.2%
mul-1-neg49.2%
distribute-rgt-neg-in49.2%
sub-neg49.2%
+-commutative49.2%
distribute-neg-in49.2%
remove-double-neg49.2%
unsub-neg49.2%
Simplified49.2%
if 4.6e154 < t Initial program 79.3%
Taylor expanded in x around 0 79.3%
associate-/l/93.8%
Simplified93.8%
Taylor expanded in t around inf 87.9%
Taylor expanded in y around 0 62.6%
mul-1-neg62.6%
associate-/r*72.8%
distribute-neg-frac272.8%
Simplified72.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* (/ x_m z) (/ 1.0 z))))
(*
x_s
(if (<= z -3e-50)
t_1
(if (<= z 1.95e-88)
(/ (/ x_m y) t)
(if (<= z 6.6e+36) (/ x_m (* z (- t))) t_1))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) * (1.0 / z);
double tmp;
if (z <= -3e-50) {
tmp = t_1;
} else if (z <= 1.95e-88) {
tmp = (x_m / y) / t;
} else if (z <= 6.6e+36) {
tmp = x_m / (z * -t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
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_m / z) * (1.0d0 / z)
if (z <= (-3d-50)) then
tmp = t_1
else if (z <= 1.95d-88) then
tmp = (x_m / y) / t
else if (z <= 6.6d+36) then
tmp = x_m / (z * -t)
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) * (1.0 / z);
double tmp;
if (z <= -3e-50) {
tmp = t_1;
} else if (z <= 1.95e-88) {
tmp = (x_m / y) / t;
} else if (z <= 6.6e+36) {
tmp = x_m / (z * -t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = (x_m / z) * (1.0 / z) tmp = 0 if z <= -3e-50: tmp = t_1 elif z <= 1.95e-88: tmp = (x_m / y) / t elif z <= 6.6e+36: tmp = x_m / (z * -t) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / z) * Float64(1.0 / z)) tmp = 0.0 if (z <= -3e-50) tmp = t_1; elseif (z <= 1.95e-88) tmp = Float64(Float64(x_m / y) / t); elseif (z <= 6.6e+36) tmp = Float64(x_m / Float64(z * Float64(-t))); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = (x_m / z) * (1.0 / z);
tmp = 0.0;
if (z <= -3e-50)
tmp = t_1;
elseif (z <= 1.95e-88)
tmp = (x_m / y) / t;
elseif (z <= 6.6e+36)
tmp = x_m / (z * -t);
else
tmp = t_1;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3e-50], t$95$1, If[LessEqual[z, 1.95e-88], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 6.6e+36], N[(x$95$m / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z} \cdot \frac{1}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-88}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+36}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -2.9999999999999999e-50 or 6.5999999999999997e36 < z Initial program 88.3%
Taylor expanded in y around 0 77.2%
mul-1-neg77.2%
distribute-rgt-neg-in77.2%
sub-neg77.2%
+-commutative77.2%
distribute-neg-in77.2%
remove-double-neg77.2%
unsub-neg77.2%
Simplified77.2%
Taylor expanded in z around inf 65.4%
associate-/r*72.1%
div-inv72.1%
Applied egg-rr72.1%
if -2.9999999999999999e-50 < z < 1.94999999999999996e-88Initial program 96.7%
Taylor expanded in y around inf 80.1%
associate-/r*79.3%
Simplified79.3%
Taylor expanded in t around inf 62.6%
if 1.94999999999999996e-88 < z < 6.5999999999999997e36Initial program 99.8%
Taylor expanded in y around 0 66.2%
mul-1-neg66.2%
distribute-rgt-neg-in66.2%
sub-neg66.2%
+-commutative66.2%
distribute-neg-in66.2%
remove-double-neg66.2%
unsub-neg66.2%
Simplified66.2%
Taylor expanded in z around 0 46.0%
associate-*r/46.0%
neg-mul-146.0%
*-commutative46.0%
Simplified46.0%
Final simplification65.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* z z))))
(*
x_s
(if (<= z -1.08e-47)
t_1
(if (<= z 1e-88)
(/ (/ x_m y) t)
(if (<= z 5e+37) (/ x_m (* z (- t))) t_1))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * z);
double tmp;
if (z <= -1.08e-47) {
tmp = t_1;
} else if (z <= 1e-88) {
tmp = (x_m / y) / t;
} else if (z <= 5e+37) {
tmp = x_m / (z * -t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
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_m / (z * z)
if (z <= (-1.08d-47)) then
tmp = t_1
else if (z <= 1d-88) then
tmp = (x_m / y) / t
else if (z <= 5d+37) then
tmp = x_m / (z * -t)
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * z);
double tmp;
if (z <= -1.08e-47) {
tmp = t_1;
} else if (z <= 1e-88) {
tmp = (x_m / y) / t;
} else if (z <= 5e+37) {
tmp = x_m / (z * -t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / (z * z) tmp = 0 if z <= -1.08e-47: tmp = t_1 elif z <= 1e-88: tmp = (x_m / y) / t elif z <= 5e+37: tmp = x_m / (z * -t) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(z * z)) tmp = 0.0 if (z <= -1.08e-47) tmp = t_1; elseif (z <= 1e-88) tmp = Float64(Float64(x_m / y) / t); elseif (z <= 5e+37) tmp = Float64(x_m / Float64(z * Float64(-t))); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / (z * z);
tmp = 0.0;
if (z <= -1.08e-47)
tmp = t_1;
elseif (z <= 1e-88)
tmp = (x_m / y) / t;
elseif (z <= 5e+37)
tmp = x_m / (z * -t);
else
tmp = t_1;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.08e-47], t$95$1, If[LessEqual[z, 1e-88], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 5e+37], N[(x$95$m / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-88}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+37}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.08000000000000005e-47 or 4.99999999999999989e37 < z Initial program 88.3%
Taylor expanded in y around 0 77.2%
mul-1-neg77.2%
distribute-rgt-neg-in77.2%
sub-neg77.2%
+-commutative77.2%
distribute-neg-in77.2%
remove-double-neg77.2%
unsub-neg77.2%
Simplified77.2%
Taylor expanded in z around inf 65.4%
if -1.08000000000000005e-47 < z < 9.99999999999999934e-89Initial program 96.7%
Taylor expanded in y around inf 80.1%
associate-/r*79.3%
Simplified79.3%
Taylor expanded in t around inf 62.6%
if 9.99999999999999934e-89 < z < 4.99999999999999989e37Initial program 99.8%
Taylor expanded in y around 0 66.2%
mul-1-neg66.2%
distribute-rgt-neg-in66.2%
sub-neg66.2%
+-commutative66.2%
distribute-neg-in66.2%
remove-double-neg66.2%
unsub-neg66.2%
Simplified66.2%
Taylor expanded in z around 0 46.0%
associate-*r/46.0%
neg-mul-146.0%
*-commutative46.0%
Simplified46.0%
Final simplification62.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -6e+86) (not (<= z 2e+140)))
(/ (/ x_m z) (- z t))
(/ x_m (* (- y z) (- t z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -6e+86) || !(z <= 2e+140)) {
tmp = (x_m / z) / (z - t);
} else {
tmp = x_m / ((y - z) * (t - z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-6d+86)) .or. (.not. (z <= 2d+140))) then
tmp = (x_m / z) / (z - t)
else
tmp = x_m / ((y - z) * (t - z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -6e+86) || !(z <= 2e+140)) {
tmp = (x_m / z) / (z - t);
} else {
tmp = x_m / ((y - z) * (t - z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -6e+86) or not (z <= 2e+140): tmp = (x_m / z) / (z - t) else: tmp = x_m / ((y - z) * (t - z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -6e+86) || !(z <= 2e+140)) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -6e+86) || ~((z <= 2e+140)))
tmp = (x_m / z) / (z - t);
else
tmp = x_m / ((y - z) * (t - z));
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -6e+86], N[Not[LessEqual[z, 2e+140]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+86} \lor \neg \left(z \leq 2 \cdot 10^{+140}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -5.99999999999999954e86 or 2.00000000000000012e140 < z Initial program 81.8%
Taylor expanded in y around 0 80.7%
mul-1-neg80.7%
associate-/r*96.5%
distribute-neg-frac296.5%
sub-neg96.5%
+-commutative96.5%
distribute-neg-in96.5%
remove-double-neg96.5%
unsub-neg96.5%
Simplified96.5%
if -5.99999999999999954e86 < z < 2.00000000000000012e140Initial program 97.6%
Final simplification97.3%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -9.5e-78)
(/ x_m (* y (- t z)))
(if (<= y 4.5e-65) (/ 1.0 (* z (/ (- z t) x_m))) (/ (/ x_m (- y z)) t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -9.5e-78) {
tmp = x_m / (y * (t - z));
} else if (y <= 4.5e-65) {
tmp = 1.0 / (z * ((z - t) / x_m));
} else {
tmp = (x_m / (y - z)) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9.5d-78)) then
tmp = x_m / (y * (t - z))
else if (y <= 4.5d-65) then
tmp = 1.0d0 / (z * ((z - t) / x_m))
else
tmp = (x_m / (y - z)) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -9.5e-78) {
tmp = x_m / (y * (t - z));
} else if (y <= 4.5e-65) {
tmp = 1.0 / (z * ((z - t) / x_m));
} else {
tmp = (x_m / (y - z)) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -9.5e-78: tmp = x_m / (y * (t - z)) elif y <= 4.5e-65: tmp = 1.0 / (z * ((z - t) / x_m)) else: tmp = (x_m / (y - z)) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -9.5e-78) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 4.5e-65) tmp = Float64(1.0 / Float64(z * Float64(Float64(z - t) / x_m))); else tmp = Float64(Float64(x_m / Float64(y - z)) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -9.5e-78)
tmp = x_m / (y * (t - z));
elseif (y <= 4.5e-65)
tmp = 1.0 / (z * ((z - t) / x_m));
else
tmp = (x_m / (y - z)) / t;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -9.5e-78], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-65], N[(1.0 / N[(z * N[(N[(z - t), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-65}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z - t}{x\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\end{array}
\end{array}
if y < -9.4999999999999997e-78Initial program 93.4%
Taylor expanded in y around inf 78.6%
*-commutative78.6%
Simplified78.6%
if -9.4999999999999997e-78 < y < 4.4999999999999998e-65Initial program 93.3%
Taylor expanded in y around 0 81.2%
mul-1-neg81.2%
distribute-rgt-neg-in81.2%
sub-neg81.2%
+-commutative81.2%
distribute-neg-in81.2%
remove-double-neg81.2%
unsub-neg81.2%
Simplified81.2%
clear-num80.2%
inv-pow80.2%
Applied egg-rr80.2%
unpow-180.2%
associate-/l*84.1%
Simplified84.1%
if 4.4999999999999998e-65 < y Initial program 91.1%
Taylor expanded in x around 0 91.1%
associate-/l/98.6%
Simplified98.6%
Taylor expanded in t around inf 62.5%
Final simplification76.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -9.5e-78)
(/ x_m (* y (- t z)))
(if (<= y 1.16e-92) (/ (/ x_m z) (- z t)) (/ (/ x_m (- y z)) t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -9.5e-78) {
tmp = x_m / (y * (t - z));
} else if (y <= 1.16e-92) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / (y - z)) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9.5d-78)) then
tmp = x_m / (y * (t - z))
else if (y <= 1.16d-92) then
tmp = (x_m / z) / (z - t)
else
tmp = (x_m / (y - z)) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -9.5e-78) {
tmp = x_m / (y * (t - z));
} else if (y <= 1.16e-92) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / (y - z)) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -9.5e-78: tmp = x_m / (y * (t - z)) elif y <= 1.16e-92: tmp = (x_m / z) / (z - t) else: tmp = (x_m / (y - z)) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -9.5e-78) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 1.16e-92) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(Float64(x_m / Float64(y - z)) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -9.5e-78)
tmp = x_m / (y * (t - z));
elseif (y <= 1.16e-92)
tmp = (x_m / z) / (z - t);
else
tmp = (x_m / (y - z)) / t;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -9.5e-78], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.16e-92], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{-92}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\end{array}
\end{array}
if y < -9.4999999999999997e-78Initial program 93.4%
Taylor expanded in y around inf 78.6%
*-commutative78.6%
Simplified78.6%
if -9.4999999999999997e-78 < y < 1.1599999999999999e-92Initial program 93.8%
Taylor expanded in y around 0 81.8%
mul-1-neg81.8%
associate-/r*86.0%
distribute-neg-frac286.0%
sub-neg86.0%
+-commutative86.0%
distribute-neg-in86.0%
remove-double-neg86.0%
unsub-neg86.0%
Simplified86.0%
if 1.1599999999999999e-92 < y Initial program 90.7%
Taylor expanded in x around 0 90.7%
associate-/l/98.7%
Simplified98.7%
Taylor expanded in t around inf 62.1%
Final simplification76.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -8.2e-78)
(/ x_m (* y (- t z)))
(if (<= y 2.05e-91) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -8.2e-78) {
tmp = x_m / (y * (t - z));
} else if (y <= 2.05e-91) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-8.2d-78)) then
tmp = x_m / (y * (t - z))
else if (y <= 2.05d-91) then
tmp = (x_m / z) / (z - t)
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -8.2e-78) {
tmp = x_m / (y * (t - z));
} else if (y <= 2.05e-91) {
tmp = (x_m / z) / (z - t);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -8.2e-78: tmp = x_m / (y * (t - z)) elif y <= 2.05e-91: tmp = (x_m / z) / (z - t) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -8.2e-78) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 2.05e-91) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -8.2e-78)
tmp = x_m / (y * (t - z));
elseif (y <= 2.05e-91)
tmp = (x_m / z) / (z - t);
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -8.2e-78], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-91], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-78}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-91}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -8.1999999999999996e-78Initial program 93.4%
Taylor expanded in y around inf 78.6%
*-commutative78.6%
Simplified78.6%
if -8.1999999999999996e-78 < y < 2.05000000000000012e-91Initial program 93.8%
Taylor expanded in y around 0 81.8%
mul-1-neg81.8%
associate-/r*86.0%
distribute-neg-frac286.0%
sub-neg86.0%
+-commutative86.0%
distribute-neg-in86.0%
remove-double-neg86.0%
unsub-neg86.0%
Simplified86.0%
if 2.05000000000000012e-91 < y Initial program 90.7%
associate-/l/97.6%
Simplified97.6%
Taylor expanded in t around inf 60.7%
Final simplification76.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -1.35e-104)
(/ x_m (* y (- t z)))
(if (<= t 7e-22) (/ x_m (* z (- z y))) (/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -1.35e-104) {
tmp = x_m / (y * (t - z));
} else if (t <= 7e-22) {
tmp = x_m / (z * (z - y));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.35d-104)) then
tmp = x_m / (y * (t - z))
else if (t <= 7d-22) then
tmp = x_m / (z * (z - y))
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -1.35e-104) {
tmp = x_m / (y * (t - z));
} else if (t <= 7e-22) {
tmp = x_m / (z * (z - y));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -1.35e-104: tmp = x_m / (y * (t - z)) elif t <= 7e-22: tmp = x_m / (z * (z - y)) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -1.35e-104) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (t <= 7e-22) tmp = Float64(x_m / Float64(z * Float64(z - y))); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= -1.35e-104)
tmp = x_m / (y * (t - z));
elseif (t <= 7e-22)
tmp = x_m / (z * (z - y));
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -1.35e-104], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-22], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-104}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-22}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.3499999999999999e-104Initial program 95.4%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
Simplified53.3%
if -1.3499999999999999e-104 < t < 7.00000000000000011e-22Initial program 94.4%
Taylor expanded in t around 0 82.5%
mul-1-neg82.5%
distribute-rgt-neg-in82.5%
neg-sub082.5%
sub-neg82.5%
+-commutative82.5%
associate--r+82.5%
neg-sub082.5%
remove-double-neg82.5%
Simplified82.5%
if 7.00000000000000011e-22 < t Initial program 86.9%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in t around inf 84.8%
Final simplification73.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -1.1e-103)
(/ x_m (* y (- t z)))
(if (<= t 7.8e-22) (/ x_m (* z (- z y))) (/ x_m (* (- y z) t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -1.1e-103) {
tmp = x_m / (y * (t - z));
} else if (t <= 7.8e-22) {
tmp = x_m / (z * (z - y));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.1d-103)) then
tmp = x_m / (y * (t - z))
else if (t <= 7.8d-22) then
tmp = x_m / (z * (z - y))
else
tmp = x_m / ((y - z) * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -1.1e-103) {
tmp = x_m / (y * (t - z));
} else if (t <= 7.8e-22) {
tmp = x_m / (z * (z - y));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -1.1e-103: tmp = x_m / (y * (t - z)) elif t <= 7.8e-22: tmp = x_m / (z * (z - y)) else: tmp = x_m / ((y - z) * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -1.1e-103) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (t <= 7.8e-22) tmp = Float64(x_m / Float64(z * Float64(z - y))); else tmp = Float64(x_m / Float64(Float64(y - z) * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= -1.1e-103)
tmp = x_m / (y * (t - z));
elseif (t <= 7.8e-22)
tmp = x_m / (z * (z - y));
else
tmp = x_m / ((y - z) * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -1.1e-103], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.8e-22], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-103}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-22}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.1e-103Initial program 95.4%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
Simplified53.3%
if -1.1e-103 < t < 7.79999999999999996e-22Initial program 94.4%
Taylor expanded in t around 0 82.5%
mul-1-neg82.5%
distribute-rgt-neg-in82.5%
neg-sub082.5%
sub-neg82.5%
+-commutative82.5%
associate--r+82.5%
neg-sub082.5%
remove-double-neg82.5%
Simplified82.5%
if 7.79999999999999996e-22 < t Initial program 86.9%
Taylor expanded in t around inf 84.7%
Final simplification73.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -3.5e-80)
(/ x_m (* y (- t z)))
(if (<= y 9.2e-51) (/ x_m (* z (- z t))) (/ (/ x_m y) t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -3.5e-80) {
tmp = x_m / (y * (t - z));
} else if (y <= 9.2e-51) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.5d-80)) then
tmp = x_m / (y * (t - z))
else if (y <= 9.2d-51) then
tmp = x_m / (z * (z - t))
else
tmp = (x_m / y) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -3.5e-80) {
tmp = x_m / (y * (t - z));
} else if (y <= 9.2e-51) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -3.5e-80: tmp = x_m / (y * (t - z)) elif y <= 9.2e-51: tmp = x_m / (z * (z - t)) else: tmp = (x_m / y) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -3.5e-80) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 9.2e-51) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x_m / y) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -3.5e-80)
tmp = x_m / (y * (t - z));
elseif (y <= 9.2e-51)
tmp = x_m / (z * (z - t));
else
tmp = (x_m / y) / t;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -3.5e-80], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-51], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-51}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if y < -3.50000000000000015e-80Initial program 93.4%
Taylor expanded in y around inf 78.6%
*-commutative78.6%
Simplified78.6%
if -3.50000000000000015e-80 < y < 9.20000000000000007e-51Initial program 93.4%
Taylor expanded in y around 0 81.6%
mul-1-neg81.6%
distribute-rgt-neg-in81.6%
sub-neg81.6%
+-commutative81.6%
distribute-neg-in81.6%
remove-double-neg81.6%
unsub-neg81.6%
Simplified81.6%
if 9.20000000000000007e-51 < y Initial program 90.8%
Taylor expanded in y around inf 77.7%
associate-/r*82.0%
Simplified82.0%
Taylor expanded in t around inf 54.1%
Final simplification73.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -7.8e-48) (not (<= z 1.3e+79)))
(/ x_m (* z z))
(/ (/ x_m y) t))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -7.8e-48) || !(z <= 1.3e+79)) {
tmp = x_m / (z * z);
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-7.8d-48)) .or. (.not. (z <= 1.3d+79))) then
tmp = x_m / (z * z)
else
tmp = (x_m / y) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -7.8e-48) || !(z <= 1.3e+79)) {
tmp = x_m / (z * z);
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -7.8e-48) or not (z <= 1.3e+79): tmp = x_m / (z * z) else: tmp = (x_m / y) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -7.8e-48) || !(z <= 1.3e+79)) tmp = Float64(x_m / Float64(z * z)); else tmp = Float64(Float64(x_m / y) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -7.8e-48) || ~((z <= 1.3e+79)))
tmp = x_m / (z * z);
else
tmp = (x_m / y) / t;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -7.8e-48], N[Not[LessEqual[z, 1.3e+79]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-48} \lor \neg \left(z \leq 1.3 \cdot 10^{+79}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if z < -7.800000000000001e-48 or 1.30000000000000007e79 < z Initial program 87.5%
Taylor expanded in y around 0 79.5%
mul-1-neg79.5%
distribute-rgt-neg-in79.5%
sub-neg79.5%
+-commutative79.5%
distribute-neg-in79.5%
remove-double-neg79.5%
unsub-neg79.5%
Simplified79.5%
Taylor expanded in z around inf 67.6%
if -7.800000000000001e-48 < z < 1.30000000000000007e79Initial program 97.6%
Taylor expanded in y around inf 70.3%
associate-/r*69.7%
Simplified69.7%
Taylor expanded in t around inf 52.8%
Final simplification60.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -1.05e-47) (not (<= z 2.4e-72)))
(/ x_m (* z z))
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-47) || !(z <= 2.4e-72)) {
tmp = x_m / (z * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.05d-47)) .or. (.not. (z <= 2.4d-72))) then
tmp = x_m / (z * z)
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-47) || !(z <= 2.4e-72)) {
tmp = x_m / (z * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -1.05e-47) or not (z <= 2.4e-72): tmp = x_m / (z * z) else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -1.05e-47) || !(z <= 2.4e-72)) tmp = Float64(x_m / Float64(z * z)); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -1.05e-47) || ~((z <= 2.4e-72)))
tmp = x_m / (z * z);
else
tmp = x_m / (y * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.05e-47], N[Not[LessEqual[z, 2.4e-72]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-47} \lor \neg \left(z \leq 2.4 \cdot 10^{-72}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.05e-47 or 2.4e-72 < z Initial program 90.0%
Taylor expanded in y around 0 75.9%
mul-1-neg75.9%
distribute-rgt-neg-in75.9%
sub-neg75.9%
+-commutative75.9%
distribute-neg-in75.9%
remove-double-neg75.9%
unsub-neg75.9%
Simplified75.9%
Taylor expanded in z around inf 59.1%
if -1.05e-47 < z < 2.4e-72Initial program 96.8%
Taylor expanded in z around 0 61.4%
Final simplification60.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -6.8e-44) (not (<= z 1.25e+68)))
(/ x_m (* y z))
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -6.8e-44) || !(z <= 1.25e+68)) {
tmp = x_m / (y * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-6.8d-44)) .or. (.not. (z <= 1.25d+68))) then
tmp = x_m / (y * z)
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -6.8e-44) || !(z <= 1.25e+68)) {
tmp = x_m / (y * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -6.8e-44) or not (z <= 1.25e+68): tmp = x_m / (y * z) else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -6.8e-44) || !(z <= 1.25e+68)) tmp = Float64(x_m / Float64(y * z)); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -6.8e-44) || ~((z <= 1.25e+68)))
tmp = x_m / (y * z);
else
tmp = x_m / (y * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -6.8e-44], N[Not[LessEqual[z, 1.25e+68]], $MachinePrecision]], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-44} \lor \neg \left(z \leq 1.25 \cdot 10^{+68}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -6.80000000000000033e-44 or 1.2500000000000001e68 < z Initial program 87.7%
Taylor expanded in t around 0 76.4%
mul-1-neg76.4%
associate-/r*84.1%
distribute-neg-frac284.1%
neg-sub084.1%
sub-neg84.1%
+-commutative84.1%
associate--r+84.1%
neg-sub084.1%
remove-double-neg84.1%
Simplified84.1%
Taylor expanded in z around 0 38.8%
neg-mul-138.8%
Simplified38.8%
add-sqr-sqrt19.2%
sqrt-unprod30.5%
sqr-neg30.5%
sqrt-unprod16.8%
div-inv16.8%
add-sqr-sqrt34.8%
associate-/l*30.0%
Applied egg-rr30.0%
associate-/l/30.0%
associate-*r/30.0%
*-rgt-identity30.0%
Simplified30.0%
if -6.80000000000000033e-44 < z < 1.2500000000000001e68Initial program 97.5%
Taylor expanded in z around 0 51.5%
Final simplification40.9%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ x_m (* y t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * (x_m / (y * t))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): return x_s * (x_m / (y * t))
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(x_m / Float64(y * t))) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp = code(x_s, x_m, y, z, t)
tmp = x_s * (x_m / (y * t));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \frac{x\_m}{y \cdot t}
\end{array}
Initial program 92.7%
Taylor expanded in z around 0 34.4%
Final simplification34.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / 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 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024144
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))
(/ x (* (- y z) (- t z))))