
(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 15 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 1 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 -5e-292) 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 <= -5e-292) {
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 <= (-5d-292)) 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 <= -5e-292) {
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 <= -5e-292: 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 <= -5e-292) 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 <= -5e-292)
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, -5e-292], 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 -5 \cdot 10^{-292}:\\
\;\;\;\;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))) < -4.99999999999999981e-292Initial program 99.5%
if -4.99999999999999981e-292 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 84.1%
associate-/l/95.9%
Simplified95.9%
Final simplification96.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 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 -1.66e-6)
(/ (/ x_m y) (- t z))
(if (<= y -3.4e-126)
t_1
(if (<= y -3.45e-212)
(/ x_m (* (- y z) t))
(if (<= y 2.65e-216) 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 <= -1.66e-6) {
tmp = (x_m / y) / (t - z);
} else if (y <= -3.4e-126) {
tmp = t_1;
} else if (y <= -3.45e-212) {
tmp = x_m / ((y - z) * t);
} else if (y <= 2.65e-216) {
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 <= (-1.66d-6)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-3.4d-126)) then
tmp = t_1
else if (y <= (-3.45d-212)) then
tmp = x_m / ((y - z) * t)
else if (y <= 2.65d-216) 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 <= -1.66e-6) {
tmp = (x_m / y) / (t - z);
} else if (y <= -3.4e-126) {
tmp = t_1;
} else if (y <= -3.45e-212) {
tmp = x_m / ((y - z) * t);
} else if (y <= 2.65e-216) {
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 <= -1.66e-6: tmp = (x_m / y) / (t - z) elif y <= -3.4e-126: tmp = t_1 elif y <= -3.45e-212: tmp = x_m / ((y - z) * t) elif y <= 2.65e-216: 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 <= -1.66e-6) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -3.4e-126) tmp = t_1; elseif (y <= -3.45e-212) tmp = Float64(x_m / Float64(Float64(y - z) * t)); elseif (y <= 2.65e-216) 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 <= -1.66e-6)
tmp = (x_m / y) / (t - z);
elseif (y <= -3.4e-126)
tmp = t_1;
elseif (y <= -3.45e-212)
tmp = x_m / ((y - z) * t);
elseif (y <= 2.65e-216)
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, -1.66e-6], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.4e-126], t$95$1, If[LessEqual[y, -3.45e-212], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.65e-216], 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 -1.66 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.45 \cdot 10^{-212}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{-216}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
\end{array}
if y < -1.65999999999999999e-6Initial program 80.7%
Taylor expanded in y around inf 79.4%
associate-/r*91.7%
Simplified91.7%
if -1.65999999999999999e-6 < y < -3.4e-126 or -3.45000000000000014e-212 < y < 2.64999999999999989e-216Initial program 94.1%
Taylor expanded in x around 0 94.1%
associate-/l/98.0%
Simplified98.0%
Taylor expanded in y around 0 90.6%
mul-1-neg90.6%
distribute-neg-frac290.6%
Simplified90.6%
if -3.4e-126 < y < -3.45000000000000014e-212Initial program 94.8%
Taylor expanded in t around inf 67.8%
if 2.64999999999999989e-216 < y Initial program 88.2%
Taylor expanded in t around inf 55.8%
associate-/r*59.4%
Simplified59.4%
Final simplification75.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 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 -8.5e-7)
(/ -1.0 (* y (/ (- z t) x_m)))
(if (<= y -2e-125)
t_1
(if (<= y -2.85e-212)
(/ x_m (* (- y z) t))
(if (<= y 1.6e-215) 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 <= -8.5e-7) {
tmp = -1.0 / (y * ((z - t) / x_m));
} else if (y <= -2e-125) {
tmp = t_1;
} else if (y <= -2.85e-212) {
tmp = x_m / ((y - z) * t);
} else if (y <= 1.6e-215) {
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 <= (-8.5d-7)) then
tmp = (-1.0d0) / (y * ((z - t) / x_m))
else if (y <= (-2d-125)) then
tmp = t_1
else if (y <= (-2.85d-212)) then
tmp = x_m / ((y - z) * t)
else if (y <= 1.6d-215) 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 <= -8.5e-7) {
tmp = -1.0 / (y * ((z - t) / x_m));
} else if (y <= -2e-125) {
tmp = t_1;
} else if (y <= -2.85e-212) {
tmp = x_m / ((y - z) * t);
} else if (y <= 1.6e-215) {
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 <= -8.5e-7: tmp = -1.0 / (y * ((z - t) / x_m)) elif y <= -2e-125: tmp = t_1 elif y <= -2.85e-212: tmp = x_m / ((y - z) * t) elif y <= 1.6e-215: 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 <= -8.5e-7) tmp = Float64(-1.0 / Float64(y * Float64(Float64(z - t) / x_m))); elseif (y <= -2e-125) tmp = t_1; elseif (y <= -2.85e-212) tmp = Float64(x_m / Float64(Float64(y - z) * t)); elseif (y <= 1.6e-215) 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 <= -8.5e-7)
tmp = -1.0 / (y * ((z - t) / x_m));
elseif (y <= -2e-125)
tmp = t_1;
elseif (y <= -2.85e-212)
tmp = x_m / ((y - z) * t);
elseif (y <= 1.6e-215)
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, -8.5e-7], N[(-1.0 / N[(y * N[(N[(z - t), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2e-125], t$95$1, If[LessEqual[y, -2.85e-212], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-215], 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 -8.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{y \cdot \frac{z - t}{x\_m}}\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.85 \cdot 10^{-212}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
\end{array}
if y < -8.50000000000000014e-7Initial program 80.7%
Taylor expanded in y around inf 79.4%
*-commutative79.4%
Simplified79.4%
clear-num78.5%
inv-pow78.5%
*-commutative78.5%
associate-/l*89.9%
Applied egg-rr89.9%
unpow-189.9%
Simplified89.9%
if -8.50000000000000014e-7 < y < -2.00000000000000002e-125 or -2.8499999999999998e-212 < y < 1.6000000000000001e-215Initial program 94.1%
Taylor expanded in x around 0 94.1%
associate-/l/98.0%
Simplified98.0%
Taylor expanded in y around 0 90.6%
mul-1-neg90.6%
distribute-neg-frac290.6%
Simplified90.6%
if -2.00000000000000002e-125 < y < -2.8499999999999998e-212Initial program 94.8%
Taylor expanded in t around inf 67.8%
if 1.6000000000000001e-215 < y Initial program 88.2%
Taylor expanded in t around inf 55.8%
associate-/r*59.4%
Simplified59.4%
Final simplification75.1%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 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 -2.4e+194)
t_1
(if (<= y -2.8e+171)
(/ x_m (* y (- z)))
(if (<= y -230.0)
t_1
(if (<= y 1.25e-128) (/ (/ 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 t_1 = (x_m / y) / t;
double tmp;
if (y <= -2.4e+194) {
tmp = t_1;
} else if (y <= -2.8e+171) {
tmp = x_m / (y * -z);
} else if (y <= -230.0) {
tmp = t_1;
} else if (y <= 1.25e-128) {
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) :: t_1
real(8) :: tmp
t_1 = (x_m / y) / t
if (y <= (-2.4d+194)) then
tmp = t_1
else if (y <= (-2.8d+171)) then
tmp = x_m / (y * -z)
else if (y <= (-230.0d0)) then
tmp = t_1
else if (y <= 1.25d-128) 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 t_1 = (x_m / y) / t;
double tmp;
if (y <= -2.4e+194) {
tmp = t_1;
} else if (y <= -2.8e+171) {
tmp = x_m / (y * -z);
} else if (y <= -230.0) {
tmp = t_1;
} else if (y <= 1.25e-128) {
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): t_1 = (x_m / y) / t tmp = 0 if y <= -2.4e+194: tmp = t_1 elif y <= -2.8e+171: tmp = x_m / (y * -z) elif y <= -230.0: tmp = t_1 elif y <= 1.25e-128: 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) t_1 = Float64(Float64(x_m / y) / t) tmp = 0.0 if (y <= -2.4e+194) tmp = t_1; elseif (y <= -2.8e+171) tmp = Float64(x_m / Float64(y * Float64(-z))); elseif (y <= -230.0) tmp = t_1; elseif (y <= 1.25e-128) 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)
t_1 = (x_m / y) / t;
tmp = 0.0;
if (y <= -2.4e+194)
tmp = t_1;
elseif (y <= -2.8e+171)
tmp = x_m / (y * -z);
elseif (y <= -230.0)
tmp = t_1;
elseif (y <= 1.25e-128)
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_] := Block[{t$95$1 = N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -2.4e+194], t$95$1, If[LessEqual[y, -2.8e+171], N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -230.0], t$95$1, If[LessEqual[y, 1.25e-128], N[(N[(x$95$m / (-z)), $MachinePrecision] / t), $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])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{y}}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+194}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{+171}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;y \leq -230:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-128}:\\
\;\;\;\;\frac{\frac{x\_m}{-z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
\end{array}
if y < -2.4e194 or -2.80000000000000004e171 < y < -230Initial program 80.3%
Taylor expanded in z around 0 51.0%
clear-num50.3%
associate-/r/50.9%
*-commutative50.9%
associate-/r*52.5%
Applied egg-rr52.5%
*-commutative52.5%
associate-*r/65.9%
div-inv65.9%
Applied egg-rr65.9%
if -2.4e194 < y < -2.80000000000000004e171Initial program 81.6%
Taylor expanded in y around inf 81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in t around 0 81.6%
mul-1-neg81.6%
distribute-neg-frac281.6%
*-commutative81.6%
distribute-rgt-neg-in81.6%
Simplified81.6%
if -230 < y < 1.25e-128Initial program 92.2%
Taylor expanded in t around inf 62.5%
Taylor expanded in y around 0 50.2%
mul-1-neg50.2%
associate-/r*50.6%
Simplified50.6%
Taylor expanded in x around 0 50.2%
*-commutative50.2%
associate-/r*55.5%
Simplified55.5%
if 1.25e-128 < y Initial program 89.1%
Taylor expanded in z around 0 44.9%
clear-num44.2%
associate-/r/45.0%
*-commutative45.0%
associate-/r*44.9%
Applied egg-rr44.9%
associate-*l/56.1%
associate-*l/56.1%
*-un-lft-identity56.1%
add-sqr-sqrt22.9%
sqrt-unprod30.8%
sqr-neg30.8%
sqrt-unprod13.7%
add-sqr-sqrt27.6%
associate-/l/19.7%
associate-/r*19.5%
add-sqr-sqrt7.7%
sqrt-unprod28.0%
sqr-neg28.0%
sqrt-unprod21.9%
add-sqr-sqrt48.6%
Applied egg-rr48.6%
Final simplification56.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 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 -3.6e-43)
(/ 1.0 (* y (/ t x_m)))
(if (<= t 9.2e-110) (/ (- x_m) (* y z)) (/ 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 <= -3.6e-43) {
tmp = 1.0 / (y * (t / x_m));
} else if (t <= 9.2e-110) {
tmp = -x_m / (y * z);
} 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 <= (-3.6d-43)) then
tmp = 1.0d0 / (y * (t / x_m))
else if (t <= 9.2d-110) then
tmp = -x_m / (y * z)
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 <= -3.6e-43) {
tmp = 1.0 / (y * (t / x_m));
} else if (t <= 9.2e-110) {
tmp = -x_m / (y * z);
} 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 <= -3.6e-43: tmp = 1.0 / (y * (t / x_m)) elif t <= 9.2e-110: tmp = -x_m / (y * z) 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 <= -3.6e-43) tmp = Float64(1.0 / Float64(y * Float64(t / x_m))); elseif (t <= 9.2e-110) tmp = Float64(Float64(-x_m) / Float64(y * z)); 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 <= -3.6e-43)
tmp = 1.0 / (y * (t / x_m));
elseif (t <= 9.2e-110)
tmp = -x_m / (y * z);
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, -3.6e-43], N[(1.0 / N[(y * N[(t / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e-110], N[((-x$95$m) / N[(y * z), $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 -3.6 \cdot 10^{-43}:\\
\;\;\;\;\frac{1}{y \cdot \frac{t}{x\_m}}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-110}:\\
\;\;\;\;\frac{-x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -3.5999999999999999e-43Initial program 83.6%
Taylor expanded in z around 0 48.0%
clear-num48.3%
inv-pow48.3%
*-commutative48.3%
associate-/l*56.6%
Applied egg-rr56.6%
unpow-156.6%
Simplified56.6%
if -3.5999999999999999e-43 < t < 9.2000000000000006e-110Initial program 92.3%
Taylor expanded in y around inf 65.3%
*-commutative65.3%
Simplified65.3%
Taylor expanded in t around 0 53.1%
mul-1-neg53.1%
distribute-neg-frac253.1%
*-commutative53.1%
distribute-rgt-neg-in53.1%
Simplified53.1%
if 9.2000000000000006e-110 < t Initial program 86.2%
Taylor expanded in t around inf 75.1%
Final simplification60.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 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.2e-6)
(/ (/ x_m y) (- t z))
(if (<= y -7.2e-144) (/ 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 (y <= -2.2e-6) {
tmp = (x_m / y) / (t - z);
} else if (y <= -7.2e-144) {
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 (y <= (-2.2d-6)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-7.2d-144)) 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 (y <= -2.2e-6) {
tmp = (x_m / y) / (t - z);
} else if (y <= -7.2e-144) {
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 y <= -2.2e-6: tmp = (x_m / y) / (t - z) elif y <= -7.2e-144: 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 (y <= -2.2e-6) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -7.2e-144) 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 (y <= -2.2e-6)
tmp = (x_m / y) / (t - z);
elseif (y <= -7.2e-144)
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[y, -2.2e-6], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.2e-144], 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}\;y \leq -2.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{-144}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.2000000000000001e-6Initial program 80.7%
Taylor expanded in y around inf 79.4%
associate-/r*91.7%
Simplified91.7%
if -2.2000000000000001e-6 < y < -7.2000000000000001e-144Initial program 91.0%
Taylor expanded in t around 0 49.7%
associate-*r/49.7%
neg-mul-149.7%
Simplified49.7%
if -7.2000000000000001e-144 < y Initial program 90.5%
Taylor expanded in t around inf 57.5%
associate-/r*59.1%
Simplified59.1%
Final simplification67.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 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 -1650.0)
(/ (/ x_m y) t)
(if (<= y 3.6e-57) (/ (/ x_m t) (- 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 (y <= -1650.0) {
tmp = (x_m / y) / t;
} else if (y <= 3.6e-57) {
tmp = (x_m / t) / -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 (y <= (-1650.0d0)) then
tmp = (x_m / y) / t
else if (y <= 3.6d-57) then
tmp = (x_m / t) / -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 (y <= -1650.0) {
tmp = (x_m / y) / t;
} else if (y <= 3.6e-57) {
tmp = (x_m / t) / -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 y <= -1650.0: tmp = (x_m / y) / t elif y <= 3.6e-57: tmp = (x_m / t) / -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 (y <= -1650.0) tmp = Float64(Float64(x_m / y) / t); elseif (y <= 3.6e-57) tmp = Float64(Float64(x_m / t) / 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 (y <= -1650.0)
tmp = (x_m / y) / t;
elseif (y <= 3.6e-57)
tmp = (x_m / t) / -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[y, -1650.0], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 3.6e-57], N[(N[(x$95$m / t), $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}\;y \leq -1650:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-57}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if y < -1650Initial program 80.4%
Taylor expanded in z around 0 49.1%
clear-num48.5%
associate-/r/49.0%
*-commutative49.0%
associate-/r*50.5%
Applied egg-rr50.5%
*-commutative50.5%
associate-*r/64.2%
div-inv64.3%
Applied egg-rr64.3%
if -1650 < y < 3.6000000000000002e-57Initial program 92.3%
Taylor expanded in t around inf 62.0%
Taylor expanded in y around 0 48.1%
mul-1-neg48.1%
associate-/r*48.9%
Simplified48.9%
if 3.6000000000000002e-57 < y Initial program 88.4%
Taylor expanded in z around 0 46.1%
clear-num45.3%
associate-/r/46.2%
*-commutative46.2%
associate-/r*46.1%
Applied egg-rr46.1%
associate-*l/58.0%
associate-*l/58.0%
*-un-lft-identity58.0%
add-sqr-sqrt23.0%
sqrt-unprod30.6%
sqr-neg30.6%
sqrt-unprod14.4%
add-sqr-sqrt28.1%
associate-/l/18.8%
associate-/r*18.6%
add-sqr-sqrt7.3%
sqrt-unprod27.3%
sqr-neg27.3%
sqrt-unprod21.8%
add-sqr-sqrt50.4%
Applied egg-rr50.4%
Final simplification53.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 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 -220.0)
(/ (/ x_m y) t)
(if (<= y 2.15e-128) (/ (/ 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 <= -220.0) {
tmp = (x_m / y) / t;
} else if (y <= 2.15e-128) {
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 <= (-220.0d0)) then
tmp = (x_m / y) / t
else if (y <= 2.15d-128) 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 <= -220.0) {
tmp = (x_m / y) / t;
} else if (y <= 2.15e-128) {
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 <= -220.0: tmp = (x_m / y) / t elif y <= 2.15e-128: 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 <= -220.0) tmp = Float64(Float64(x_m / y) / t); elseif (y <= 2.15e-128) 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 <= -220.0)
tmp = (x_m / y) / t;
elseif (y <= 2.15e-128)
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, -220.0], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 2.15e-128], N[(N[(x$95$m / (-z)), $MachinePrecision] / t), $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 -220:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-128}:\\
\;\;\;\;\frac{\frac{x\_m}{-z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if y < -220Initial program 80.4%
Taylor expanded in z around 0 49.1%
clear-num48.5%
associate-/r/49.0%
*-commutative49.0%
associate-/r*50.5%
Applied egg-rr50.5%
*-commutative50.5%
associate-*r/64.2%
div-inv64.3%
Applied egg-rr64.3%
if -220 < y < 2.14999999999999997e-128Initial program 92.2%
Taylor expanded in t around inf 62.5%
Taylor expanded in y around 0 50.2%
mul-1-neg50.2%
associate-/r*50.6%
Simplified50.6%
Taylor expanded in x around 0 50.2%
*-commutative50.2%
associate-/r*55.5%
Simplified55.5%
if 2.14999999999999997e-128 < y Initial program 89.1%
Taylor expanded in z around 0 44.9%
clear-num44.2%
associate-/r/45.0%
*-commutative45.0%
associate-/r*44.9%
Applied egg-rr44.9%
associate-*l/56.1%
associate-*l/56.1%
*-un-lft-identity56.1%
add-sqr-sqrt22.9%
sqrt-unprod30.8%
sqr-neg30.8%
sqrt-unprod13.7%
add-sqr-sqrt27.6%
associate-/l/19.7%
associate-/r*19.5%
add-sqr-sqrt7.7%
sqrt-unprod28.0%
sqr-neg28.0%
sqrt-unprod21.9%
add-sqr-sqrt48.6%
Applied egg-rr48.6%
Final simplification55.4%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 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.25e+27) (not (<= z 3.3e+52)))
(/ 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.25e+27) || !(z <= 3.3e+52)) {
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.25d+27)) .or. (.not. (z <= 3.3d+52))) 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.25e+27) || !(z <= 3.3e+52)) {
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.25e+27) or not (z <= 3.3e+52): 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.25e+27) || !(z <= 3.3e+52)) 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.25e+27) || ~((z <= 3.3e+52)))
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.25e+27], N[Not[LessEqual[z, 3.3e+52]], $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.25 \cdot 10^{+27} \lor \neg \left(z \leq 3.3 \cdot 10^{+52}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.24999999999999995e27 or 3.3e52 < z Initial program 83.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 86.8%
associate-*r/86.8%
neg-mul-186.8%
Simplified86.8%
div-inv86.7%
associate-/l*77.8%
add-sqr-sqrt38.0%
sqrt-unprod71.7%
sqr-neg71.7%
sqrt-unprod34.5%
add-sqr-sqrt65.3%
Applied egg-rr65.3%
associate-/r*65.3%
associate-*r/65.3%
*-rgt-identity65.3%
Simplified65.3%
Taylor expanded in z around 0 39.3%
if -1.24999999999999995e27 < z < 3.3e52Initial program 90.4%
Taylor expanded in z around 0 50.2%
Final simplification45.8%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 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 -9.2e+104) (not (<= z 2.2e+133)))
(/ 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 <= -9.2e+104) || !(z <= 2.2e+133)) {
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 <= (-9.2d+104)) .or. (.not. (z <= 2.2d+133))) 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 <= -9.2e+104) || !(z <= 2.2e+133)) {
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 <= -9.2e+104) or not (z <= 2.2e+133): 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 <= -9.2e+104) || !(z <= 2.2e+133)) 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 <= -9.2e+104) || ~((z <= 2.2e+133)))
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, -9.2e+104], N[Not[LessEqual[z, 2.2e+133]], $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 -9.2 \cdot 10^{+104} \lor \neg \left(z \leq 2.2 \cdot 10^{+133}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -9.19999999999999938e104 or 2.2e133 < z Initial program 81.6%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around 0 92.9%
associate-*r/92.9%
neg-mul-192.9%
Simplified92.9%
div-inv92.8%
associate-/l*82.3%
add-sqr-sqrt38.9%
sqrt-unprod77.7%
sqr-neg77.7%
sqrt-unprod39.9%
add-sqr-sqrt74.8%
Applied egg-rr74.8%
associate-/r*74.8%
associate-*r/74.8%
*-rgt-identity74.8%
Simplified74.8%
Taylor expanded in z around 0 44.4%
if -9.19999999999999938e104 < z < 2.2e133Initial program 90.1%
Taylor expanded in z around 0 43.7%
clear-num43.0%
associate-/r/43.6%
*-commutative43.6%
associate-/r*44.2%
Applied egg-rr44.2%
associate-*l/51.3%
associate-*l/51.4%
*-un-lft-identity51.4%
add-sqr-sqrt24.2%
sqrt-unprod27.9%
sqr-neg27.9%
sqrt-unprod10.8%
add-sqr-sqrt20.9%
associate-/l/17.3%
associate-/r*18.9%
add-sqr-sqrt8.7%
sqrt-unprod28.4%
sqr-neg28.4%
sqrt-unprod24.5%
add-sqr-sqrt49.9%
Applied egg-rr49.9%
Final simplification48.4%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 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.5e+128) (/ (/ x_m y) (- t z)) (/ 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 (y <= -2.5e+128) {
tmp = (x_m / y) / (t - z);
} 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 (y <= (-2.5d+128)) then
tmp = (x_m / y) / (t - z)
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 (y <= -2.5e+128) {
tmp = (x_m / y) / (t - z);
} 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 y <= -2.5e+128: tmp = (x_m / y) / (t - z) 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 (y <= -2.5e+128) tmp = Float64(Float64(x_m / y) / Float64(t - z)); 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 (y <= -2.5e+128)
tmp = (x_m / y) / (t - z);
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[LessEqual[y, -2.5e+128], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $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}\;y \leq -2.5 \cdot 10^{+128}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if y < -2.5e128Initial program 73.9%
Taylor expanded in y around inf 73.9%
associate-/r*93.4%
Simplified93.4%
if -2.5e128 < y Initial program 90.5%
Final simplification91.0%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 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 5.6e-44) (/ x_m (* y (- t z))) (/ 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 <= 5.6e-44) {
tmp = x_m / (y * (t - z));
} 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 <= 5.6d-44) then
tmp = x_m / (y * (t - z))
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 <= 5.6e-44) {
tmp = x_m / (y * (t - z));
} 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 <= 5.6e-44: tmp = x_m / (y * (t - z)) 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 <= 5.6e-44) tmp = Float64(x_m / Float64(y * Float64(t - z))); 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 <= 5.6e-44)
tmp = x_m / (y * (t - z));
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, 5.6e-44], N[(x$95$m / N[(y * N[(t - z), $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 5.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 5.6e-44Initial program 88.5%
Taylor expanded in y around inf 60.3%
*-commutative60.3%
Simplified60.3%
if 5.6e-44 < t Initial program 85.6%
Taylor expanded in t around inf 74.3%
Final simplification63.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 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 5.6e-44) (/ x_m (* y (- 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 (t <= 5.6e-44) {
tmp = x_m / (y * (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 (t <= 5.6d-44) then
tmp = x_m / (y * (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 (t <= 5.6e-44) {
tmp = x_m / (y * (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 t <= 5.6e-44: tmp = x_m / (y * (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 (t <= 5.6e-44) tmp = Float64(x_m / Float64(y * 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 (t <= 5.6e-44)
tmp = x_m / (y * (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[t, 5.6e-44], N[(x$95$m / N[(y * 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}\;t \leq 5.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < 5.6e-44Initial program 88.5%
Taylor expanded in y around inf 60.3%
*-commutative60.3%
Simplified60.3%
if 5.6e-44 < t Initial program 85.6%
Taylor expanded in t around inf 74.3%
associate-/r*81.7%
Simplified81.7%
Final simplification65.7%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 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.3e-106) (/ (/ x_m y) (- 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 (t <= 2.3e-106) {
tmp = (x_m / y) / (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 (t <= 2.3d-106) then
tmp = (x_m / y) / (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 (t <= 2.3e-106) {
tmp = (x_m / y) / (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 t <= 2.3e-106: tmp = (x_m / y) / (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 (t <= 2.3e-106) tmp = Float64(Float64(x_m / y) / 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 (t <= 2.3e-106)
tmp = (x_m / y) / (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[t, 2.3e-106], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $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 2.3 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.3000000000000001e-106Initial program 88.4%
Taylor expanded in y around inf 59.1%
associate-/r*63.5%
Simplified63.5%
if 2.3000000000000001e-106 < t Initial program 86.2%
Taylor expanded in t around inf 75.1%
associate-/r*81.6%
Simplified81.6%
Final simplification68.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 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 87.8%
Taylor expanded in z around 0 37.1%
Final simplification37.1%
(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 2024043
(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))))