
(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 20 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 -2e-270) 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 <= -2e-270) {
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 <= (-2d-270)) 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 <= -2e-270) {
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 <= -2e-270: 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 <= -2e-270) 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 <= -2e-270)
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, -2e-270], 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 -2 \cdot 10^{-270}:\\
\;\;\;\;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))) < -2.0000000000000001e-270Initial program 96.4%
if -2.0000000000000001e-270 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 79.9%
associate-/l/96.5%
Simplified96.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
(let* ((t_1 (/ (/ x_m y) (- t z)))
(t_2 (* (/ 1.0 z) (/ x_m z)))
(t_3 (/ (/ x_m t) (- y z))))
(*
x_s
(if (<= z -1.82e+22)
t_2
(if (<= z -2.2e-284)
t_1
(if (<= z 3.2e-165)
t_3
(if (<= z 1.35e-71)
t_1
(if (<= z 1.8e-27) t_3 (if (<= z 6.8e+86) t_1 t_2)))))))))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 - z);
double t_2 = (1.0 / z) * (x_m / z);
double t_3 = (x_m / t) / (y - z);
double tmp;
if (z <= -1.82e+22) {
tmp = t_2;
} else if (z <= -2.2e-284) {
tmp = t_1;
} else if (z <= 3.2e-165) {
tmp = t_3;
} else if (z <= 1.35e-71) {
tmp = t_1;
} else if (z <= 1.8e-27) {
tmp = t_3;
} else if (z <= 6.8e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (x_m / y) / (t - z)
t_2 = (1.0d0 / z) * (x_m / z)
t_3 = (x_m / t) / (y - z)
if (z <= (-1.82d+22)) then
tmp = t_2
else if (z <= (-2.2d-284)) then
tmp = t_1
else if (z <= 3.2d-165) then
tmp = t_3
else if (z <= 1.35d-71) then
tmp = t_1
else if (z <= 1.8d-27) then
tmp = t_3
else if (z <= 6.8d+86) then
tmp = t_1
else
tmp = t_2
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 - z);
double t_2 = (1.0 / z) * (x_m / z);
double t_3 = (x_m / t) / (y - z);
double tmp;
if (z <= -1.82e+22) {
tmp = t_2;
} else if (z <= -2.2e-284) {
tmp = t_1;
} else if (z <= 3.2e-165) {
tmp = t_3;
} else if (z <= 1.35e-71) {
tmp = t_1;
} else if (z <= 1.8e-27) {
tmp = t_3;
} else if (z <= 6.8e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
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 - z) t_2 = (1.0 / z) * (x_m / z) t_3 = (x_m / t) / (y - z) tmp = 0 if z <= -1.82e+22: tmp = t_2 elif z <= -2.2e-284: tmp = t_1 elif z <= 3.2e-165: tmp = t_3 elif z <= 1.35e-71: tmp = t_1 elif z <= 1.8e-27: tmp = t_3 elif z <= 6.8e+86: tmp = t_1 else: tmp = t_2 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) / Float64(t - z)) t_2 = Float64(Float64(1.0 / z) * Float64(x_m / z)) t_3 = Float64(Float64(x_m / t) / Float64(y - z)) tmp = 0.0 if (z <= -1.82e+22) tmp = t_2; elseif (z <= -2.2e-284) tmp = t_1; elseif (z <= 3.2e-165) tmp = t_3; elseif (z <= 1.35e-71) tmp = t_1; elseif (z <= 1.8e-27) tmp = t_3; elseif (z <= 6.8e+86) tmp = t_1; else tmp = t_2; 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 - z);
t_2 = (1.0 / z) * (x_m / z);
t_3 = (x_m / t) / (y - z);
tmp = 0.0;
if (z <= -1.82e+22)
tmp = t_2;
elseif (z <= -2.2e-284)
tmp = t_1;
elseif (z <= 3.2e-165)
tmp = t_3;
elseif (z <= 1.35e-71)
tmp = t_1;
elseif (z <= 1.8e-27)
tmp = t_3;
elseif (z <= 6.8e+86)
tmp = t_1;
else
tmp = t_2;
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] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / z), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.82e+22], t$95$2, If[LessEqual[z, -2.2e-284], t$95$1, If[LessEqual[z, 3.2e-165], t$95$3, If[LessEqual[z, 1.35e-71], t$95$1, If[LessEqual[z, 1.8e-27], t$95$3, If[LessEqual[z, 6.8e+86], t$95$1, t$95$2]]]]]]), $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 - z}\\
t_2 := \frac{1}{z} \cdot \frac{x\_m}{z}\\
t_3 := \frac{\frac{x\_m}{t}}{y - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.82 \cdot 10^{+22}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-284}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-165}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-27}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -1.82e22 or 6.7999999999999995e86 < z Initial program 75.5%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 88.0%
associate-*r/88.0%
neg-mul-188.0%
Simplified88.0%
associate-/l/73.0%
neg-mul-173.0%
times-frac88.0%
Applied egg-rr88.0%
Taylor expanded in y around 0 79.7%
if -1.82e22 < z < -2.2000000000000001e-284 or 3.20000000000000013e-165 < z < 1.3500000000000001e-71 or 1.7999999999999999e-27 < z < 6.7999999999999995e86Initial program 92.5%
Taylor expanded in x around 0 92.5%
associate-/l/97.9%
Simplified97.9%
Taylor expanded in y around inf 66.5%
if -2.2000000000000001e-284 < z < 3.20000000000000013e-165 or 1.3500000000000001e-71 < z < 1.7999999999999999e-27Initial program 82.2%
associate-/l/92.7%
Simplified92.7%
Taylor expanded in t around inf 81.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) (- z t))))
(*
x_s
(if (<= y -3e-8)
(/ (/ x_m y) (- t z))
(if (<= y -1.5e-36)
t_1
(if (<= y -3.2e-71)
(/ x_m (* y (- t z)))
(if (<= y 9.5e-98) t_1 (/ (/ 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 t_1 = (x_m / z) / (z - t);
double tmp;
if (y <= -3e-8) {
tmp = (x_m / y) / (t - z);
} else if (y <= -1.5e-36) {
tmp = t_1;
} else if (y <= -3.2e-71) {
tmp = x_m / (y * (t - z));
} else if (y <= 9.5e-98) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x_m / z) / (z - t)
if (y <= (-3d-8)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-1.5d-36)) then
tmp = t_1
else if (y <= (-3.2d-71)) then
tmp = x_m / (y * (t - z))
else if (y <= 9.5d-98) then
tmp = t_1
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 t_1 = (x_m / z) / (z - t);
double tmp;
if (y <= -3e-8) {
tmp = (x_m / y) / (t - z);
} else if (y <= -1.5e-36) {
tmp = t_1;
} else if (y <= -3.2e-71) {
tmp = x_m / (y * (t - z));
} else if (y <= 9.5e-98) {
tmp = t_1;
} 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): t_1 = (x_m / z) / (z - t) tmp = 0 if y <= -3e-8: tmp = (x_m / y) / (t - z) elif y <= -1.5e-36: tmp = t_1 elif y <= -3.2e-71: tmp = x_m / (y * (t - z)) elif y <= 9.5e-98: tmp = t_1 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) t_1 = Float64(Float64(x_m / z) / Float64(z - t)) tmp = 0.0 if (y <= -3e-8) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -1.5e-36) tmp = t_1; elseif (y <= -3.2e-71) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 9.5e-98) tmp = t_1; 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)
t_1 = (x_m / z) / (z - t);
tmp = 0.0;
if (y <= -3e-8)
tmp = (x_m / y) / (t - z);
elseif (y <= -1.5e-36)
tmp = t_1;
elseif (y <= -3.2e-71)
tmp = x_m / (y * (t - z));
elseif (y <= 9.5e-98)
tmp = t_1;
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_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -3e-8], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.5e-36], t$95$1, If[LessEqual[y, -3.2e-71], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e-98], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{z}}{z - t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-71}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
\end{array}
if y < -2.99999999999999973e-8Initial program 84.4%
Taylor expanded in x around 0 84.4%
associate-/l/95.6%
Simplified95.6%
Taylor expanded in y around inf 84.7%
if -2.99999999999999973e-8 < y < -1.5000000000000001e-36 or -3.1999999999999999e-71 < y < 9.5000000000000001e-98Initial program 91.8%
Taylor expanded in x around 0 91.8%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in y around 0 82.5%
associate-*r/82.5%
mul-1-neg82.5%
Simplified82.5%
if -1.5000000000000001e-36 < y < -3.1999999999999999e-71Initial program 100.0%
Taylor expanded in y around inf 53.1%
*-commutative53.1%
Simplified53.1%
if 9.5000000000000001e-98 < y Initial program 72.9%
associate-/l/96.6%
Simplified96.6%
Taylor expanded in t around inf 69.1%
Final simplification77.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
(let* ((t_1 (/ x_m (* z (- z t)))))
(*
x_s
(if (<= y -2.2e-9)
(/ (/ x_m y) (- t z))
(if (<= y -6.2e-35)
t_1
(if (<= y -1.18e-85)
(/ x_m (* y (- t z)))
(if (<= y 1.55e-127) t_1 (/ (/ 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 t_1 = x_m / (z * (z - t));
double tmp;
if (y <= -2.2e-9) {
tmp = (x_m / y) / (t - z);
} else if (y <= -6.2e-35) {
tmp = t_1;
} else if (y <= -1.18e-85) {
tmp = x_m / (y * (t - z));
} else if (y <= 1.55e-127) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x_m / (z * (z - t))
if (y <= (-2.2d-9)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-6.2d-35)) then
tmp = t_1
else if (y <= (-1.18d-85)) then
tmp = x_m / (y * (t - z))
else if (y <= 1.55d-127) then
tmp = t_1
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 t_1 = x_m / (z * (z - t));
double tmp;
if (y <= -2.2e-9) {
tmp = (x_m / y) / (t - z);
} else if (y <= -6.2e-35) {
tmp = t_1;
} else if (y <= -1.18e-85) {
tmp = x_m / (y * (t - z));
} else if (y <= 1.55e-127) {
tmp = t_1;
} 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): t_1 = x_m / (z * (z - t)) tmp = 0 if y <= -2.2e-9: tmp = (x_m / y) / (t - z) elif y <= -6.2e-35: tmp = t_1 elif y <= -1.18e-85: tmp = x_m / (y * (t - z)) elif y <= 1.55e-127: tmp = t_1 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) t_1 = Float64(x_m / Float64(z * Float64(z - t))) tmp = 0.0 if (y <= -2.2e-9) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -6.2e-35) tmp = t_1; elseif (y <= -1.18e-85) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 1.55e-127) tmp = t_1; 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)
t_1 = x_m / (z * (z - t));
tmp = 0.0;
if (y <= -2.2e-9)
tmp = (x_m / y) / (t - z);
elseif (y <= -6.2e-35)
tmp = t_1;
elseif (y <= -1.18e-85)
tmp = x_m / (y * (t - z));
elseif (y <= 1.55e-127)
tmp = t_1;
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_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -2.2e-9], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.2e-35], t$95$1, If[LessEqual[y, -1.18e-85], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e-127], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.18 \cdot 10^{-85}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-127}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
\end{array}
if y < -2.1999999999999998e-9Initial program 84.4%
Taylor expanded in x around 0 84.4%
associate-/l/95.6%
Simplified95.6%
Taylor expanded in y around inf 84.7%
if -2.1999999999999998e-9 < y < -6.20000000000000024e-35 or -1.18e-85 < y < 1.55e-127Initial program 91.8%
Taylor expanded in y around 0 80.9%
associate-*r/80.9%
neg-mul-180.9%
Simplified80.9%
if -6.20000000000000024e-35 < y < -1.18e-85Initial program 99.9%
Taylor expanded in y around inf 52.5%
*-commutative52.5%
Simplified52.5%
if 1.55e-127 < y Initial program 73.9%
associate-/l/95.9%
Simplified95.9%
Taylor expanded in t around inf 68.3%
Final simplification75.6%
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 z)))) (t_2 (* (/ 1.0 z) (/ x_m z))))
(*
x_s
(if (<= z -5e+18)
t_2
(if (<= z -1.55e-108)
t_1
(if (<= z 1.2e-147)
(/ (/ x_m t) (- y z))
(if (<= z 1e+89) t_1 t_2)))))))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 - z));
double t_2 = (1.0 / z) * (x_m / z);
double tmp;
if (z <= -5e+18) {
tmp = t_2;
} else if (z <= -1.55e-108) {
tmp = t_1;
} else if (z <= 1.2e-147) {
tmp = (x_m / t) / (y - z);
} else if (z <= 1e+89) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x_m / (y * (t - z))
t_2 = (1.0d0 / z) * (x_m / z)
if (z <= (-5d+18)) then
tmp = t_2
else if (z <= (-1.55d-108)) then
tmp = t_1
else if (z <= 1.2d-147) then
tmp = (x_m / t) / (y - z)
else if (z <= 1d+89) then
tmp = t_1
else
tmp = t_2
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 - z));
double t_2 = (1.0 / z) * (x_m / z);
double tmp;
if (z <= -5e+18) {
tmp = t_2;
} else if (z <= -1.55e-108) {
tmp = t_1;
} else if (z <= 1.2e-147) {
tmp = (x_m / t) / (y - z);
} else if (z <= 1e+89) {
tmp = t_1;
} else {
tmp = t_2;
}
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 - z)) t_2 = (1.0 / z) * (x_m / z) tmp = 0 if z <= -5e+18: tmp = t_2 elif z <= -1.55e-108: tmp = t_1 elif z <= 1.2e-147: tmp = (x_m / t) / (y - z) elif z <= 1e+89: tmp = t_1 else: tmp = t_2 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(y * Float64(t - z))) t_2 = Float64(Float64(1.0 / z) * Float64(x_m / z)) tmp = 0.0 if (z <= -5e+18) tmp = t_2; elseif (z <= -1.55e-108) tmp = t_1; elseif (z <= 1.2e-147) tmp = Float64(Float64(x_m / t) / Float64(y - z)); elseif (z <= 1e+89) tmp = t_1; else tmp = t_2; 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 - z));
t_2 = (1.0 / z) * (x_m / z);
tmp = 0.0;
if (z <= -5e+18)
tmp = t_2;
elseif (z <= -1.55e-108)
tmp = t_1;
elseif (z <= 1.2e-147)
tmp = (x_m / t) / (y - z);
elseif (z <= 1e+89)
tmp = t_1;
else
tmp = t_2;
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[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / z), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -5e+18], t$95$2, If[LessEqual[z, -1.55e-108], t$95$1, If[LessEqual[z, 1.2e-147], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+89], t$95$1, t$95$2]]]]), $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}{y \cdot \left(t - z\right)}\\
t_2 := \frac{1}{z} \cdot \frac{x\_m}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-147}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{elif}\;z \leq 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -5e18 or 9.99999999999999995e88 < z Initial program 75.5%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 88.0%
associate-*r/88.0%
neg-mul-188.0%
Simplified88.0%
associate-/l/73.0%
neg-mul-173.0%
times-frac88.0%
Applied egg-rr88.0%
Taylor expanded in y around 0 79.7%
if -5e18 < z < -1.55000000000000007e-108 or 1.19999999999999999e-147 < z < 9.99999999999999995e88Initial program 97.2%
Taylor expanded in y around inf 55.9%
*-commutative55.9%
Simplified55.9%
if -1.55000000000000007e-108 < z < 1.19999999999999999e-147Initial program 80.8%
associate-/l/87.9%
Simplified87.9%
Taylor expanded in t around inf 79.6%
Final simplification72.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
(let* ((t_1 (/ x_m (* y (- t z)))) (t_2 (* (/ 1.0 z) (/ x_m z))))
(*
x_s
(if (<= z -2.35e+20)
t_2
(if (<= z -2.8e-305)
t_1
(if (<= z 1.25e-230) (/ (/ x_m t) y) (if (<= z 4.7e+86) t_1 t_2)))))))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 - z));
double t_2 = (1.0 / z) * (x_m / z);
double tmp;
if (z <= -2.35e+20) {
tmp = t_2;
} else if (z <= -2.8e-305) {
tmp = t_1;
} else if (z <= 1.25e-230) {
tmp = (x_m / t) / y;
} else if (z <= 4.7e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x_m / (y * (t - z))
t_2 = (1.0d0 / z) * (x_m / z)
if (z <= (-2.35d+20)) then
tmp = t_2
else if (z <= (-2.8d-305)) then
tmp = t_1
else if (z <= 1.25d-230) then
tmp = (x_m / t) / y
else if (z <= 4.7d+86) then
tmp = t_1
else
tmp = t_2
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 - z));
double t_2 = (1.0 / z) * (x_m / z);
double tmp;
if (z <= -2.35e+20) {
tmp = t_2;
} else if (z <= -2.8e-305) {
tmp = t_1;
} else if (z <= 1.25e-230) {
tmp = (x_m / t) / y;
} else if (z <= 4.7e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
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 - z)) t_2 = (1.0 / z) * (x_m / z) tmp = 0 if z <= -2.35e+20: tmp = t_2 elif z <= -2.8e-305: tmp = t_1 elif z <= 1.25e-230: tmp = (x_m / t) / y elif z <= 4.7e+86: tmp = t_1 else: tmp = t_2 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(y * Float64(t - z))) t_2 = Float64(Float64(1.0 / z) * Float64(x_m / z)) tmp = 0.0 if (z <= -2.35e+20) tmp = t_2; elseif (z <= -2.8e-305) tmp = t_1; elseif (z <= 1.25e-230) tmp = Float64(Float64(x_m / t) / y); elseif (z <= 4.7e+86) tmp = t_1; else tmp = t_2; 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 - z));
t_2 = (1.0 / z) * (x_m / z);
tmp = 0.0;
if (z <= -2.35e+20)
tmp = t_2;
elseif (z <= -2.8e-305)
tmp = t_1;
elseif (z <= 1.25e-230)
tmp = (x_m / t) / y;
elseif (z <= 4.7e+86)
tmp = t_1;
else
tmp = t_2;
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[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / z), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -2.35e+20], t$95$2, If[LessEqual[z, -2.8e-305], t$95$1, If[LessEqual[z, 1.25e-230], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 4.7e+86], t$95$1, t$95$2]]]]), $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}{y \cdot \left(t - z\right)}\\
t_2 := \frac{1}{z} \cdot \frac{x\_m}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{+20}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-305}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-230}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -2.35e20 or 4.7000000000000002e86 < z Initial program 75.5%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 88.0%
associate-*r/88.0%
neg-mul-188.0%
Simplified88.0%
associate-/l/73.0%
neg-mul-173.0%
times-frac88.0%
Applied egg-rr88.0%
Taylor expanded in y around 0 79.7%
if -2.35e20 < z < -2.80000000000000014e-305 or 1.25000000000000009e-230 < z < 4.7000000000000002e86Initial program 92.1%
Taylor expanded in y around inf 63.1%
*-commutative63.1%
Simplified63.1%
if -2.80000000000000014e-305 < z < 1.25000000000000009e-230Initial program 70.9%
Taylor expanded in z around 0 62.3%
associate-/r*86.9%
div-inv86.8%
Applied egg-rr86.8%
un-div-inv86.9%
Applied egg-rr86.9%
Final simplification71.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 (* (- y z) t))) (t_2 (* (/ 1.0 z) (/ x_m z))))
(*
x_s
(if (<= z -0.00115)
t_2
(if (<= z -1.26e-307)
t_1
(if (<= z 1.25e-230) (/ (/ x_m t) y) (if (<= z 8.2e+34) t_1 t_2)))))))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);
double t_2 = (1.0 / z) * (x_m / z);
double tmp;
if (z <= -0.00115) {
tmp = t_2;
} else if (z <= -1.26e-307) {
tmp = t_1;
} else if (z <= 1.25e-230) {
tmp = (x_m / t) / y;
} else if (z <= 8.2e+34) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x_m / ((y - z) * t)
t_2 = (1.0d0 / z) * (x_m / z)
if (z <= (-0.00115d0)) then
tmp = t_2
else if (z <= (-1.26d-307)) then
tmp = t_1
else if (z <= 1.25d-230) then
tmp = (x_m / t) / y
else if (z <= 8.2d+34) then
tmp = t_1
else
tmp = t_2
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);
double t_2 = (1.0 / z) * (x_m / z);
double tmp;
if (z <= -0.00115) {
tmp = t_2;
} else if (z <= -1.26e-307) {
tmp = t_1;
} else if (z <= 1.25e-230) {
tmp = (x_m / t) / y;
} else if (z <= 8.2e+34) {
tmp = t_1;
} else {
tmp = t_2;
}
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) t_2 = (1.0 / z) * (x_m / z) tmp = 0 if z <= -0.00115: tmp = t_2 elif z <= -1.26e-307: tmp = t_1 elif z <= 1.25e-230: tmp = (x_m / t) / y elif z <= 8.2e+34: tmp = t_1 else: tmp = t_2 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) * t)) t_2 = Float64(Float64(1.0 / z) * Float64(x_m / z)) tmp = 0.0 if (z <= -0.00115) tmp = t_2; elseif (z <= -1.26e-307) tmp = t_1; elseif (z <= 1.25e-230) tmp = Float64(Float64(x_m / t) / y); elseif (z <= 8.2e+34) tmp = t_1; else tmp = t_2; 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);
t_2 = (1.0 / z) * (x_m / z);
tmp = 0.0;
if (z <= -0.00115)
tmp = t_2;
elseif (z <= -1.26e-307)
tmp = t_1;
elseif (z <= 1.25e-230)
tmp = (x_m / t) / y;
elseif (z <= 8.2e+34)
tmp = t_1;
else
tmp = t_2;
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] * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / z), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -0.00115], t$95$2, If[LessEqual[z, -1.26e-307], t$95$1, If[LessEqual[z, 1.25e-230], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 8.2e+34], t$95$1, t$95$2]]]]), $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 t}\\
t_2 := \frac{1}{z} \cdot \frac{x\_m}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -0.00115:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.26 \cdot 10^{-307}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-230}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -0.00115 or 8.1999999999999997e34 < z Initial program 78.4%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 84.3%
associate-*r/84.3%
neg-mul-184.3%
Simplified84.3%
associate-/l/71.5%
neg-mul-171.5%
times-frac84.3%
Applied egg-rr84.3%
Taylor expanded in y around 0 73.9%
if -0.00115 < z < -1.2599999999999999e-307 or 1.25000000000000009e-230 < z < 8.1999999999999997e34Initial program 91.7%
Taylor expanded in t around inf 69.6%
if -1.2599999999999999e-307 < z < 1.25000000000000009e-230Initial program 70.9%
Taylor expanded in z around 0 62.3%
associate-/r*86.9%
div-inv86.8%
Applied egg-rr86.8%
un-div-inv86.9%
Applied egg-rr86.9%
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
(let* ((t_1 (/ (/ x_m y) t)) (t_2 (* (/ 1.0 z) (/ x_m z))))
(*
x_s
(if (<= z -0.0023)
t_2
(if (<= z 4.7e-147)
t_1
(if (<= z 1.7e-98) (/ (/ x_m y) (- z)) (if (<= z 8e+28) t_1 t_2)))))))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 t_2 = (1.0 / z) * (x_m / z);
double tmp;
if (z <= -0.0023) {
tmp = t_2;
} else if (z <= 4.7e-147) {
tmp = t_1;
} else if (z <= 1.7e-98) {
tmp = (x_m / y) / -z;
} else if (z <= 8e+28) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (x_m / y) / t
t_2 = (1.0d0 / z) * (x_m / z)
if (z <= (-0.0023d0)) then
tmp = t_2
else if (z <= 4.7d-147) then
tmp = t_1
else if (z <= 1.7d-98) then
tmp = (x_m / y) / -z
else if (z <= 8d+28) then
tmp = t_1
else
tmp = t_2
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 t_2 = (1.0 / z) * (x_m / z);
double tmp;
if (z <= -0.0023) {
tmp = t_2;
} else if (z <= 4.7e-147) {
tmp = t_1;
} else if (z <= 1.7e-98) {
tmp = (x_m / y) / -z;
} else if (z <= 8e+28) {
tmp = t_1;
} else {
tmp = t_2;
}
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 t_2 = (1.0 / z) * (x_m / z) tmp = 0 if z <= -0.0023: tmp = t_2 elif z <= 4.7e-147: tmp = t_1 elif z <= 1.7e-98: tmp = (x_m / y) / -z elif z <= 8e+28: tmp = t_1 else: tmp = t_2 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) t_2 = Float64(Float64(1.0 / z) * Float64(x_m / z)) tmp = 0.0 if (z <= -0.0023) tmp = t_2; elseif (z <= 4.7e-147) tmp = t_1; elseif (z <= 1.7e-98) tmp = Float64(Float64(x_m / y) / Float64(-z)); elseif (z <= 8e+28) tmp = t_1; else tmp = t_2; 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;
t_2 = (1.0 / z) * (x_m / z);
tmp = 0.0;
if (z <= -0.0023)
tmp = t_2;
elseif (z <= 4.7e-147)
tmp = t_1;
elseif (z <= 1.7e-98)
tmp = (x_m / y) / -z;
elseif (z <= 8e+28)
tmp = t_1;
else
tmp = t_2;
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]}, Block[{t$95$2 = N[(N[(1.0 / z), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -0.0023], t$95$2, If[LessEqual[z, 4.7e-147], t$95$1, If[LessEqual[z, 1.7e-98], N[(N[(x$95$m / y), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 8e+28], t$95$1, t$95$2]]]]), $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}\\
t_2 := \frac{1}{z} \cdot \frac{x\_m}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -0.0023:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-98}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{-z}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -0.0023 or 7.99999999999999967e28 < z Initial program 78.4%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 84.3%
associate-*r/84.3%
neg-mul-184.3%
Simplified84.3%
associate-/l/71.5%
neg-mul-171.5%
times-frac84.3%
Applied egg-rr84.3%
Taylor expanded in y around 0 73.9%
if -0.0023 < z < 4.69999999999999989e-147 or 1.7000000000000001e-98 < z < 7.99999999999999967e28Initial program 87.0%
associate-/r*94.2%
div-inv94.1%
Applied egg-rr94.1%
clear-num92.5%
frac-times93.3%
metadata-eval93.3%
Applied egg-rr93.3%
Taylor expanded in z around 0 55.1%
associate-/l/62.9%
Simplified62.9%
if 4.69999999999999989e-147 < z < 1.7000000000000001e-98Initial program 99.8%
Taylor expanded in x around 0 99.8%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in y around inf 58.6%
Taylor expanded in t around 0 44.0%
mul-1-neg44.0%
associate-/r*50.9%
distribute-neg-frac250.9%
Simplified50.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
(if (<= y -2.9e+66)
(/ (/ x_m y) (- t z))
(if (<= y -2.4e-182)
(/ (/ x_m z) (- z y))
(if (<= y 7e-98) (/ (/ 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 <= -2.9e+66) {
tmp = (x_m / y) / (t - z);
} else if (y <= -2.4e-182) {
tmp = (x_m / z) / (z - y);
} else if (y <= 7e-98) {
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 <= (-2.9d+66)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-2.4d-182)) then
tmp = (x_m / z) / (z - y)
else if (y <= 7d-98) 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 <= -2.9e+66) {
tmp = (x_m / y) / (t - z);
} else if (y <= -2.4e-182) {
tmp = (x_m / z) / (z - y);
} else if (y <= 7e-98) {
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 <= -2.9e+66: tmp = (x_m / y) / (t - z) elif y <= -2.4e-182: tmp = (x_m / z) / (z - y) elif y <= 7e-98: 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 <= -2.9e+66) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -2.4e-182) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (y <= 7e-98) 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 <= -2.9e+66)
tmp = (x_m / y) / (t - z);
elseif (y <= -2.4e-182)
tmp = (x_m / z) / (z - y);
elseif (y <= 7e-98)
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, -2.9e+66], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.4e-182], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-98], 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 -2.9 \cdot 10^{+66}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-182}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-98}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.89999999999999986e66Initial program 80.6%
Taylor expanded in x around 0 80.6%
associate-/l/94.9%
Simplified94.9%
Taylor expanded in y around inf 90.6%
if -2.89999999999999986e66 < y < -2.3999999999999998e-182Initial program 92.8%
associate-/l/97.9%
Simplified97.9%
Taylor expanded in t around 0 64.3%
associate-*r/64.3%
neg-mul-164.3%
Simplified64.3%
if -2.3999999999999998e-182 < y < 7.0000000000000004e-98Initial program 92.6%
Taylor expanded in x around 0 92.6%
associate-/l/97.0%
Simplified97.0%
Taylor expanded in y around 0 84.8%
associate-*r/84.8%
mul-1-neg84.8%
Simplified84.8%
if 7.0000000000000004e-98 < y Initial program 72.9%
associate-/l/96.6%
Simplified96.6%
Taylor expanded in t around inf 69.1%
Final simplification76.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 -1e+39)
(/ (/ x_m y) (- t z))
(if (<= y -5.8e-114)
(/ x_m (* z (- z y)))
(if (<= y 2.05e-125) (/ 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 <= -1e+39) {
tmp = (x_m / y) / (t - z);
} else if (y <= -5.8e-114) {
tmp = x_m / (z * (z - y));
} else if (y <= 2.05e-125) {
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 <= (-1d+39)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-5.8d-114)) then
tmp = x_m / (z * (z - y))
else if (y <= 2.05d-125) 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 <= -1e+39) {
tmp = (x_m / y) / (t - z);
} else if (y <= -5.8e-114) {
tmp = x_m / (z * (z - y));
} else if (y <= 2.05e-125) {
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 <= -1e+39: tmp = (x_m / y) / (t - z) elif y <= -5.8e-114: tmp = x_m / (z * (z - y)) elif y <= 2.05e-125: 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 <= -1e+39) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -5.8e-114) tmp = Float64(x_m / Float64(z * Float64(z - y))); elseif (y <= 2.05e-125) tmp = Float64(x_m / Float64(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 <= -1e+39)
tmp = (x_m / y) / (t - z);
elseif (y <= -5.8e-114)
tmp = x_m / (z * (z - y));
elseif (y <= 2.05e-125)
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, -1e+39], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.8e-114], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-125], N[(x$95$m / N[(z * N[(z - t), $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}\;y \leq -1 \cdot 10^{+39}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{-114}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-125}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -9.9999999999999994e38Initial program 81.4%
Taylor expanded in x around 0 81.4%
associate-/l/94.7%
Simplified94.7%
Taylor expanded in y around inf 87.3%
if -9.9999999999999994e38 < y < -5.79999999999999993e-114Initial program 99.9%
Taylor expanded in t around 0 63.5%
associate-*r/63.5%
neg-mul-163.5%
Simplified63.5%
if -5.79999999999999993e-114 < y < 2.0499999999999999e-125Initial program 90.9%
Taylor expanded in y around 0 81.2%
associate-*r/81.2%
neg-mul-181.2%
Simplified81.2%
if 2.0499999999999999e-125 < y Initial program 73.6%
associate-/l/95.8%
Simplified95.8%
Taylor expanded in t around inf 69.0%
Final simplification75.6%
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 -1.2e+182)
(/ (/ x_m y) (- t z))
(if (<= y 1.75e-116) (/ x_m (* (- y z) (- t z))) (/ (/ 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 <= -1.2e+182) {
tmp = (x_m / y) / (t - z);
} else if (y <= 1.75e-116) {
tmp = x_m / ((y - z) * (t - z));
} 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 <= (-1.2d+182)) then
tmp = (x_m / y) / (t - z)
else if (y <= 1.75d-116) then
tmp = x_m / ((y - z) * (t - z))
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 <= -1.2e+182) {
tmp = (x_m / y) / (t - z);
} else if (y <= 1.75e-116) {
tmp = x_m / ((y - z) * (t - z));
} 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 <= -1.2e+182: tmp = (x_m / y) / (t - z) elif y <= 1.75e-116: tmp = x_m / ((y - z) * (t - z)) 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 <= -1.2e+182) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 1.75e-116) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); 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 <= -1.2e+182)
tmp = (x_m / y) / (t - z);
elseif (y <= 1.75e-116)
tmp = x_m / ((y - z) * (t - z));
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, -1.2e+182], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e-116], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $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}\;y \leq -1.2 \cdot 10^{+182}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-116}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.20000000000000005e182Initial program 73.2%
Taylor expanded in x around 0 73.2%
associate-/l/89.4%
Simplified89.4%
Taylor expanded in y around inf 89.4%
if -1.20000000000000005e182 < y < 1.74999999999999992e-116Initial program 92.3%
if 1.74999999999999992e-116 < y Initial program 73.0%
associate-/l/96.7%
Simplified96.7%
Taylor expanded in t around inf 70.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 (or (<= t -2.7e-19) (not (<= t 2.35e-88)))
(/ (/ x_m y) t)
(/ (- x_m) (* 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 <= -2.7e-19) || !(t <= 2.35e-88)) {
tmp = (x_m / y) / t;
} else {
tmp = -x_m / (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 <= (-2.7d-19)) .or. (.not. (t <= 2.35d-88))) then
tmp = (x_m / y) / t
else
tmp = -x_m / (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 <= -2.7e-19) || !(t <= 2.35e-88)) {
tmp = (x_m / y) / t;
} else {
tmp = -x_m / (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 <= -2.7e-19) or not (t <= 2.35e-88): tmp = (x_m / y) / t else: tmp = -x_m / (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 <= -2.7e-19) || !(t <= 2.35e-88)) tmp = Float64(Float64(x_m / y) / t); else tmp = Float64(Float64(-x_m) / 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 <= -2.7e-19) || ~((t <= 2.35e-88)))
tmp = (x_m / y) / t;
else
tmp = -x_m / (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[Or[LessEqual[t, -2.7e-19], N[Not[LessEqual[t, 2.35e-88]], $MachinePrecision]], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], N[((-x$95$m) / 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 -2.7 \cdot 10^{-19} \lor \neg \left(t \leq 2.35 \cdot 10^{-88}\right):\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x\_m}{y \cdot z}\\
\end{array}
\end{array}
if t < -2.7000000000000001e-19 or 2.35e-88 < t Initial program 83.1%
associate-/r*97.8%
div-inv97.7%
Applied egg-rr97.7%
clear-num97.6%
frac-times97.5%
metadata-eval97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 49.8%
associate-/l/57.2%
Simplified57.2%
if -2.7000000000000001e-19 < t < 2.35e-88Initial program 84.7%
associate-/l/96.2%
Simplified96.2%
Taylor expanded in t around 0 76.1%
associate-*r/76.1%
neg-mul-176.1%
Simplified76.1%
Taylor expanded in z around 0 33.0%
associate-*r/33.0%
mul-1-neg33.0%
*-commutative33.0%
Simplified33.0%
Final simplification47.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 (<= t -2.8e-19)
(/ (/ x_m y) t)
(if (<= t 1.65e+62) (/ (/ x_m (- z)) y) (/ (/ x_m t) y)))))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 <= -2.8e-19) {
tmp = (x_m / y) / t;
} else if (t <= 1.65e+62) {
tmp = (x_m / -z) / y;
} else {
tmp = (x_m / t) / y;
}
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 <= (-2.8d-19)) then
tmp = (x_m / y) / t
else if (t <= 1.65d+62) then
tmp = (x_m / -z) / y
else
tmp = (x_m / t) / y
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 <= -2.8e-19) {
tmp = (x_m / y) / t;
} else if (t <= 1.65e+62) {
tmp = (x_m / -z) / y;
} else {
tmp = (x_m / t) / y;
}
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 <= -2.8e-19: tmp = (x_m / y) / t elif t <= 1.65e+62: tmp = (x_m / -z) / y else: tmp = (x_m / t) / y 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 <= -2.8e-19) tmp = Float64(Float64(x_m / y) / t); elseif (t <= 1.65e+62) tmp = Float64(Float64(x_m / Float64(-z)) / y); else tmp = Float64(Float64(x_m / t) / y); 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 <= -2.8e-19)
tmp = (x_m / y) / t;
elseif (t <= 1.65e+62)
tmp = (x_m / -z) / y;
else
tmp = (x_m / t) / y;
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, -2.8e-19], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.65e+62], N[(N[(x$95$m / (-z)), $MachinePrecision] / y), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $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 -2.8 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{x\_m}{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if t < -2.80000000000000003e-19Initial program 82.2%
associate-/r*99.7%
div-inv99.7%
Applied egg-rr99.7%
clear-num99.6%
frac-times99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 51.5%
associate-/l/60.5%
Simplified60.5%
if -2.80000000000000003e-19 < t < 1.65e62Initial program 85.7%
Taylor expanded in x around 0 85.7%
associate-/l/96.7%
Simplified96.7%
Taylor expanded in y around inf 53.6%
Taylor expanded in t around 0 31.2%
mul-1-neg31.2%
associate-/r*34.8%
distribute-neg-frac234.8%
Simplified34.8%
Taylor expanded in x around 0 31.2%
mul-1-neg31.2%
*-commutative31.2%
associate-/r*39.0%
distribute-neg-frac239.0%
Simplified39.0%
if 1.65e62 < t Initial program 80.7%
Taylor expanded in z around 0 53.4%
associate-/r*57.2%
div-inv57.2%
Applied egg-rr57.2%
un-div-inv57.2%
Applied egg-rr57.2%
Final simplification48.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
(*
x_s
(if (<= t -2.7e-19)
(/ (/ x_m y) t)
(if (<= t 850000.0) (/ (/ x_m y) (- z)) (/ (/ x_m t) y)))))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 <= -2.7e-19) {
tmp = (x_m / y) / t;
} else if (t <= 850000.0) {
tmp = (x_m / y) / -z;
} else {
tmp = (x_m / t) / y;
}
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 <= (-2.7d-19)) then
tmp = (x_m / y) / t
else if (t <= 850000.0d0) then
tmp = (x_m / y) / -z
else
tmp = (x_m / t) / y
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 <= -2.7e-19) {
tmp = (x_m / y) / t;
} else if (t <= 850000.0) {
tmp = (x_m / y) / -z;
} else {
tmp = (x_m / t) / y;
}
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 <= -2.7e-19: tmp = (x_m / y) / t elif t <= 850000.0: tmp = (x_m / y) / -z else: tmp = (x_m / t) / y 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 <= -2.7e-19) tmp = Float64(Float64(x_m / y) / t); elseif (t <= 850000.0) tmp = Float64(Float64(x_m / y) / Float64(-z)); else tmp = Float64(Float64(x_m / t) / y); 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 <= -2.7e-19)
tmp = (x_m / y) / t;
elseif (t <= 850000.0)
tmp = (x_m / y) / -z;
else
tmp = (x_m / t) / y;
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, -2.7e-19], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 850000.0], N[(N[(x$95$m / y), $MachinePrecision] / (-z)), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $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 -2.7 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;t \leq 850000:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if t < -2.7000000000000001e-19Initial program 82.2%
associate-/r*99.7%
div-inv99.7%
Applied egg-rr99.7%
clear-num99.6%
frac-times99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 51.5%
associate-/l/60.5%
Simplified60.5%
if -2.7000000000000001e-19 < t < 8.5e5Initial program 86.2%
Taylor expanded in x around 0 86.2%
associate-/l/96.4%
Simplified96.4%
Taylor expanded in y around inf 53.7%
Taylor expanded in t around 0 32.1%
mul-1-neg32.1%
associate-/r*36.1%
distribute-neg-frac236.1%
Simplified36.1%
if 8.5e5 < t Initial program 81.0%
Taylor expanded in z around 0 47.5%
associate-/r*53.3%
div-inv53.3%
Applied egg-rr53.3%
un-div-inv53.3%
Applied egg-rr53.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 -1.6e-182)
(/ (/ x_m y) t)
(if (<= y 6.5e-98) (/ (- x_m) (* z t)) (/ (/ x_m t) y)))))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 <= -1.6e-182) {
tmp = (x_m / y) / t;
} else if (y <= 6.5e-98) {
tmp = -x_m / (z * t);
} else {
tmp = (x_m / t) / y;
}
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 <= (-1.6d-182)) then
tmp = (x_m / y) / t
else if (y <= 6.5d-98) then
tmp = -x_m / (z * t)
else
tmp = (x_m / t) / y
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 <= -1.6e-182) {
tmp = (x_m / y) / t;
} else if (y <= 6.5e-98) {
tmp = -x_m / (z * t);
} else {
tmp = (x_m / t) / y;
}
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 <= -1.6e-182: tmp = (x_m / y) / t elif y <= 6.5e-98: tmp = -x_m / (z * t) else: tmp = (x_m / t) / y 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 <= -1.6e-182) tmp = Float64(Float64(x_m / y) / t); elseif (y <= 6.5e-98) tmp = Float64(Float64(-x_m) / Float64(z * t)); else tmp = Float64(Float64(x_m / t) / y); 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 <= -1.6e-182)
tmp = (x_m / y) / t;
elseif (y <= 6.5e-98)
tmp = -x_m / (z * t);
else
tmp = (x_m / t) / y;
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, -1.6e-182], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 6.5e-98], N[((-x$95$m) / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $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 -1.6 \cdot 10^{-182}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-98}:\\
\;\;\;\;\frac{-x\_m}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if y < -1.60000000000000001e-182Initial program 87.3%
associate-/r*97.0%
div-inv96.9%
Applied egg-rr96.9%
clear-num95.6%
frac-times95.8%
metadata-eval95.8%
Applied egg-rr95.8%
Taylor expanded in z around 0 41.4%
associate-/l/47.1%
Simplified47.1%
if -1.60000000000000001e-182 < y < 6.50000000000000017e-98Initial program 92.6%
associate-/l/94.5%
Simplified94.5%
Taylor expanded in t around inf 57.5%
Taylor expanded in y around 0 54.4%
associate-*r/54.4%
mul-1-neg54.4%
Simplified54.4%
if 6.50000000000000017e-98 < y Initial program 72.9%
Taylor expanded in z around 0 49.3%
associate-/r*55.9%
div-inv55.8%
Applied egg-rr55.8%
un-div-inv55.9%
Applied egg-rr55.9%
Final simplification52.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 (or (<= z -1.35e+115) (not (<= z 4.6e+75)))
(/ 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 <= -1.35e+115) || !(z <= 4.6e+75)) {
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 <= (-1.35d+115)) .or. (.not. (z <= 4.6d+75))) 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 <= -1.35e+115) || !(z <= 4.6e+75)) {
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 <= -1.35e+115) or not (z <= 4.6e+75): 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 <= -1.35e+115) || !(z <= 4.6e+75)) tmp = Float64(x_m / Float64(y * 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 <= -1.35e+115) || ~((z <= 4.6e+75)))
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, -1.35e+115], N[Not[LessEqual[z, 4.6e+75]], $MachinePrecision]], N[(x$95$m / N[(y * 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 -1.35 \cdot 10^{+115} \lor \neg \left(z \leq 4.6 \cdot 10^{+75}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if z < -1.35000000000000002e115 or 4.5999999999999997e75 < z Initial program 76.4%
Taylor expanded in x around 0 76.4%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in y around inf 39.5%
Taylor expanded in t around 0 32.3%
mul-1-neg32.3%
associate-/r*36.3%
distribute-neg-frac236.3%
Simplified36.3%
div-inv36.3%
*-un-lft-identity36.3%
times-frac31.2%
/-rgt-identity31.2%
add-sqr-sqrt14.4%
sqrt-unprod56.6%
sqr-neg56.6%
sqrt-unprod16.9%
add-sqr-sqrt31.4%
Applied egg-rr31.4%
associate-/l/32.5%
associate-*r/32.5%
*-rgt-identity32.5%
Simplified32.5%
if -1.35000000000000002e115 < z < 4.5999999999999997e75Initial program 87.5%
associate-/r*95.6%
div-inv95.5%
Applied egg-rr95.5%
clear-num94.4%
frac-times95.0%
metadata-eval95.0%
Applied egg-rr95.0%
Taylor expanded in z around 0 49.1%
associate-/l/55.5%
Simplified55.5%
Final simplification47.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
(*
x_s
(if (or (<= z -1.35e+116) (not (<= z 1.75e+75)))
(/ x_m (* y z))
(/ (/ x_m t) y))))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.35e+116) || !(z <= 1.75e+75)) {
tmp = x_m / (y * z);
} else {
tmp = (x_m / t) / y;
}
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.35d+116)) .or. (.not. (z <= 1.75d+75))) then
tmp = x_m / (y * z)
else
tmp = (x_m / t) / y
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.35e+116) || !(z <= 1.75e+75)) {
tmp = x_m / (y * z);
} else {
tmp = (x_m / t) / y;
}
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.35e+116) or not (z <= 1.75e+75): tmp = x_m / (y * z) else: tmp = (x_m / t) / y 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.35e+116) || !(z <= 1.75e+75)) tmp = Float64(x_m / Float64(y * z)); else tmp = Float64(Float64(x_m / t) / y); 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.35e+116) || ~((z <= 1.75e+75)))
tmp = x_m / (y * z);
else
tmp = (x_m / t) / y;
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.35e+116], N[Not[LessEqual[z, 1.75e+75]], $MachinePrecision]], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $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.35 \cdot 10^{+116} \lor \neg \left(z \leq 1.75 \cdot 10^{+75}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -1.35e116 or 1.7499999999999999e75 < z Initial program 76.4%
Taylor expanded in x around 0 76.4%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in y around inf 39.5%
Taylor expanded in t around 0 32.3%
mul-1-neg32.3%
associate-/r*36.3%
distribute-neg-frac236.3%
Simplified36.3%
div-inv36.3%
*-un-lft-identity36.3%
times-frac31.2%
/-rgt-identity31.2%
add-sqr-sqrt14.4%
sqrt-unprod56.6%
sqr-neg56.6%
sqrt-unprod16.9%
add-sqr-sqrt31.4%
Applied egg-rr31.4%
associate-/l/32.5%
associate-*r/32.5%
*-rgt-identity32.5%
Simplified32.5%
if -1.35e116 < z < 1.7499999999999999e75Initial program 87.5%
Taylor expanded in z around 0 49.1%
associate-/r*54.3%
div-inv54.3%
Applied egg-rr54.3%
un-div-inv54.3%
Applied egg-rr54.3%
Final simplification46.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
(if (or (<= z -1.6e+115) (not (<= z 1.55e+69)))
(/ 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 <= -1.6e+115) || !(z <= 1.55e+69)) {
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 <= (-1.6d+115)) .or. (.not. (z <= 1.55d+69))) 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 <= -1.6e+115) || !(z <= 1.55e+69)) {
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 <= -1.6e+115) or not (z <= 1.55e+69): 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 <= -1.6e+115) || !(z <= 1.55e+69)) 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 <= -1.6e+115) || ~((z <= 1.55e+69)))
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, -1.6e+115], N[Not[LessEqual[z, 1.55e+69]], $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 -1.6 \cdot 10^{+115} \lor \neg \left(z \leq 1.55 \cdot 10^{+69}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.6e115 or 1.5499999999999999e69 < z Initial program 76.4%
Taylor expanded in x around 0 76.4%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in y around inf 39.5%
Taylor expanded in t around 0 32.3%
mul-1-neg32.3%
associate-/r*36.3%
distribute-neg-frac236.3%
Simplified36.3%
div-inv36.3%
*-un-lft-identity36.3%
times-frac31.2%
/-rgt-identity31.2%
add-sqr-sqrt14.4%
sqrt-unprod56.6%
sqr-neg56.6%
sqrt-unprod16.9%
add-sqr-sqrt31.4%
Applied egg-rr31.4%
associate-/l/32.5%
associate-*r/32.5%
*-rgt-identity32.5%
Simplified32.5%
if -1.6e115 < z < 1.5499999999999999e69Initial program 87.5%
Taylor expanded in z around 0 49.1%
Final simplification43.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 (/ (/ 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) {
return x_s * ((x_m / (y - z)) / (t - z));
}
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 - z)) / (t - z))
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 - z)) / (t - z));
}
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 - z)) / (t - z))
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(Float64(x_m / Float64(y - z)) / Float64(t - z))) 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 - z)) / (t - z));
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[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - 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 \frac{\frac{x\_m}{y - z}}{t - z}
\end{array}
Initial program 83.7%
Taylor expanded in x around 0 83.7%
associate-/l/97.0%
Simplified97.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 (/ 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 83.7%
Taylor expanded in z around 0 38.2%
Final simplification38.2%
(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 2024101
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))