
(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 18 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-312) 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-312) {
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-312)) 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-312) {
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-312: 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-312) 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-312)
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-312], 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^{-312}:\\
\;\;\;\;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.0000000000019e-312Initial program 98.2%
if -2.0000000000019e-312 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 82.2%
associate-/l/97.4%
Simplified97.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 z))) (t_2 (* (- y z) (- t z))))
(*
x_s
(if (<= t_2 (- INFINITY))
(/ t_1 t)
(if (<= t_2 5e+306) (/ x_m t_2) (* t_1 (/ -1.0 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);
double t_2 = (y - z) * (t - z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1 / t;
} else if (t_2 <= 5e+306) {
tmp = x_m / t_2;
} else {
tmp = t_1 * (-1.0 / z);
}
return x_s * tmp;
}
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);
double t_2 = (y - z) * (t - z);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1 / t;
} else if (t_2 <= 5e+306) {
tmp = x_m / t_2;
} else {
tmp = t_1 * (-1.0 / 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_2 = (y - z) * (t - z) tmp = 0 if t_2 <= -math.inf: tmp = t_1 / t elif t_2 <= 5e+306: tmp = x_m / t_2 else: tmp = t_1 * (-1.0 / 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(y - z)) t_2 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_1 / t); elseif (t_2 <= 5e+306) tmp = Float64(x_m / t_2); else tmp = Float64(t_1 * Float64(-1.0 / 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_2 = (y - z) * (t - z);
tmp = 0.0;
if (t_2 <= -Inf)
tmp = t_1 / t;
elseif (t_2 <= 5e+306)
tmp = x_m / t_2;
else
tmp = t_1 * (-1.0 / 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[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(t$95$1 / t), $MachinePrecision], If[LessEqual[t$95$2, 5e+306], N[(x$95$m / t$95$2), $MachinePrecision], N[(t$95$1 * N[(-1.0 / 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}{y - z}\\
t_2 := \left(y - z\right) \cdot \left(t - z\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{t\_1}{t}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;\frac{x\_m}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{-1}{z}\\
\end{array}
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 67.7%
Taylor expanded in x around 0 67.7%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 86.3%
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 4.99999999999999993e306Initial program 99.1%
if 4.99999999999999993e306 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 68.0%
Taylor expanded in x around 0 68.0%
associate-/l/99.8%
Simplified99.8%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 84.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 (<= t -1.35e-77)
(/ (/ x_m (- t z)) y)
(if (<= t 0.0024)
(* (/ x_m (- y z)) (/ -1.0 z))
(if (<= t 2.2e+151) (/ x_m (* (- y 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 (t <= -1.35e-77) {
tmp = (x_m / (t - z)) / y;
} else if (t <= 0.0024) {
tmp = (x_m / (y - z)) * (-1.0 / z);
} else if (t <= 2.2e+151) {
tmp = x_m / ((y - 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 (t <= (-1.35d-77)) then
tmp = (x_m / (t - z)) / y
else if (t <= 0.0024d0) then
tmp = (x_m / (y - z)) * ((-1.0d0) / z)
else if (t <= 2.2d+151) then
tmp = x_m / ((y - 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 (t <= -1.35e-77) {
tmp = (x_m / (t - z)) / y;
} else if (t <= 0.0024) {
tmp = (x_m / (y - z)) * (-1.0 / z);
} else if (t <= 2.2e+151) {
tmp = x_m / ((y - 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 t <= -1.35e-77: tmp = (x_m / (t - z)) / y elif t <= 0.0024: tmp = (x_m / (y - z)) * (-1.0 / z) elif t <= 2.2e+151: tmp = x_m / ((y - 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 (t <= -1.35e-77) tmp = Float64(Float64(x_m / Float64(t - z)) / y); elseif (t <= 0.0024) tmp = Float64(Float64(x_m / Float64(y - z)) * Float64(-1.0 / z)); elseif (t <= 2.2e+151) tmp = Float64(x_m / Float64(Float64(y - 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 (t <= -1.35e-77)
tmp = (x_m / (t - z)) / y;
elseif (t <= 0.0024)
tmp = (x_m / (y - z)) * (-1.0 / z);
elseif (t <= 2.2e+151)
tmp = x_m / ((y - 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[t, -1.35e-77], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 0.0024], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.2e+151], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;t \leq -1.35 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
\mathbf{elif}\;t \leq 0.0024:\\
\;\;\;\;\frac{x\_m}{y - z} \cdot \frac{-1}{z}\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+151}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.35e-77Initial program 87.4%
associate-/l/97.4%
Simplified97.4%
Taylor expanded in y around inf 55.5%
if -1.35e-77 < t < 0.00239999999999999979Initial program 87.2%
Taylor expanded in x around 0 87.2%
associate-/l/97.1%
Simplified97.1%
div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in t around 0 85.4%
if 0.00239999999999999979 < t < 2.20000000000000007e151Initial program 96.2%
Taylor expanded in t around inf 83.6%
if 2.20000000000000007e151 < t Initial program 70.0%
associate-/l/97.1%
Simplified97.1%
Taylor expanded in t around inf 91.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.2e-80)
(/ (/ x_m (- t z)) y)
(if (<= t 0.0036)
(/ (/ x_m z) (- z y))
(if (<= t 3.6e+149) (/ x_m (* (- y 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 (t <= -2.2e-80) {
tmp = (x_m / (t - z)) / y;
} else if (t <= 0.0036) {
tmp = (x_m / z) / (z - y);
} else if (t <= 3.6e+149) {
tmp = x_m / ((y - 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 (t <= (-2.2d-80)) then
tmp = (x_m / (t - z)) / y
else if (t <= 0.0036d0) then
tmp = (x_m / z) / (z - y)
else if (t <= 3.6d+149) then
tmp = x_m / ((y - 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 (t <= -2.2e-80) {
tmp = (x_m / (t - z)) / y;
} else if (t <= 0.0036) {
tmp = (x_m / z) / (z - y);
} else if (t <= 3.6e+149) {
tmp = x_m / ((y - 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 t <= -2.2e-80: tmp = (x_m / (t - z)) / y elif t <= 0.0036: tmp = (x_m / z) / (z - y) elif t <= 3.6e+149: tmp = x_m / ((y - 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 (t <= -2.2e-80) tmp = Float64(Float64(x_m / Float64(t - z)) / y); elseif (t <= 0.0036) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (t <= 3.6e+149) tmp = Float64(x_m / Float64(Float64(y - 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 (t <= -2.2e-80)
tmp = (x_m / (t - z)) / y;
elseif (t <= 0.0036)
tmp = (x_m / z) / (z - y);
elseif (t <= 3.6e+149)
tmp = x_m / ((y - 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[t, -2.2e-80], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 0.0036], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e+149], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;t \leq -2.2 \cdot 10^{-80}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
\mathbf{elif}\;t \leq 0.0036:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+149}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.2000000000000001e-80Initial program 87.4%
associate-/l/97.4%
Simplified97.4%
Taylor expanded in y around inf 55.5%
if -2.2000000000000001e-80 < t < 0.0035999999999999999Initial program 87.2%
Taylor expanded in t around 0 74.8%
mul-1-neg74.8%
associate-/r*85.9%
distribute-neg-frac285.9%
neg-sub085.9%
sub-neg85.9%
+-commutative85.9%
associate--r+85.9%
neg-sub085.9%
remove-double-neg85.9%
Simplified85.9%
if 0.0035999999999999999 < t < 3.59999999999999995e149Initial program 96.2%
Taylor expanded in t around inf 83.6%
if 3.59999999999999995e149 < t Initial program 70.0%
associate-/l/97.1%
Simplified97.1%
Taylor expanded in t around inf 91.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 -9e-151)
(/ (/ x_m y) (- t z))
(if (<= t 0.004)
(/ (/ x_m z) (- z y))
(if (<= t 3.2e+151) (/ x_m (* (- y 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 (t <= -9e-151) {
tmp = (x_m / y) / (t - z);
} else if (t <= 0.004) {
tmp = (x_m / z) / (z - y);
} else if (t <= 3.2e+151) {
tmp = x_m / ((y - 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 (t <= (-9d-151)) then
tmp = (x_m / y) / (t - z)
else if (t <= 0.004d0) then
tmp = (x_m / z) / (z - y)
else if (t <= 3.2d+151) then
tmp = x_m / ((y - 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 (t <= -9e-151) {
tmp = (x_m / y) / (t - z);
} else if (t <= 0.004) {
tmp = (x_m / z) / (z - y);
} else if (t <= 3.2e+151) {
tmp = x_m / ((y - 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 t <= -9e-151: tmp = (x_m / y) / (t - z) elif t <= 0.004: tmp = (x_m / z) / (z - y) elif t <= 3.2e+151: tmp = x_m / ((y - 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 (t <= -9e-151) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 0.004) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (t <= 3.2e+151) tmp = Float64(x_m / Float64(Float64(y - 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 (t <= -9e-151)
tmp = (x_m / y) / (t - z);
elseif (t <= 0.004)
tmp = (x_m / z) / (z - y);
elseif (t <= 3.2e+151)
tmp = x_m / ((y - 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[t, -9e-151], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.004], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e+151], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;t \leq -9 \cdot 10^{-151}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 0.004:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+151}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -9.0000000000000005e-151Initial program 86.9%
Taylor expanded in y around inf 52.2%
associate-/r*52.1%
Simplified52.1%
if -9.0000000000000005e-151 < t < 0.0040000000000000001Initial program 87.6%
Taylor expanded in t around 0 76.5%
mul-1-neg76.5%
associate-/r*87.1%
distribute-neg-frac287.1%
neg-sub087.1%
sub-neg87.1%
+-commutative87.1%
associate--r+87.1%
neg-sub087.1%
remove-double-neg87.1%
Simplified87.1%
if 0.0040000000000000001 < t < 3.19999999999999994e151Initial program 96.2%
Taylor expanded in t around inf 83.6%
if 3.19999999999999994e151 < t Initial program 70.0%
associate-/l/97.1%
Simplified97.1%
Taylor expanded in t around inf 91.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 (<= y -1.12e+190)
(/ (/ x_m y) (- t z))
(if (<= y -2.8e-17)
(/ x_m (* y (- t z)))
(if (<= y 7.5e-18) (/ (/ 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 <= -1.12e+190) {
tmp = (x_m / y) / (t - z);
} else if (y <= -2.8e-17) {
tmp = x_m / (y * (t - z));
} else if (y <= 7.5e-18) {
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 <= (-1.12d+190)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-2.8d-17)) then
tmp = x_m / (y * (t - z))
else if (y <= 7.5d-18) 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 <= -1.12e+190) {
tmp = (x_m / y) / (t - z);
} else if (y <= -2.8e-17) {
tmp = x_m / (y * (t - z));
} else if (y <= 7.5e-18) {
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 <= -1.12e+190: tmp = (x_m / y) / (t - z) elif y <= -2.8e-17: tmp = x_m / (y * (t - z)) elif y <= 7.5e-18: 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 <= -1.12e+190) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -2.8e-17) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 7.5e-18) 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 <= -1.12e+190)
tmp = (x_m / y) / (t - z);
elseif (y <= -2.8e-17)
tmp = x_m / (y * (t - z));
elseif (y <= 7.5e-18)
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, -1.12e+190], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.8e-17], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e-18], 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 -1.12 \cdot 10^{+190}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.12000000000000003e190Initial program 77.3%
Taylor expanded in y around inf 77.3%
associate-/r*93.3%
Simplified93.3%
if -1.12000000000000003e190 < y < -2.7999999999999999e-17Initial program 91.8%
clear-num91.6%
associate-/r/91.7%
Applied egg-rr91.7%
associate-*l/91.8%
times-frac94.3%
*-commutative94.3%
clear-num94.3%
associate-*l/95.4%
*-un-lft-identity95.4%
Applied egg-rr95.4%
Taylor expanded in y around inf 89.0%
if -2.7999999999999999e-17 < y < 7.50000000000000015e-18Initial program 88.7%
Taylor expanded in y around 0 76.2%
mul-1-neg76.2%
associate-/r*84.1%
distribute-neg-frac284.1%
sub-neg84.1%
+-commutative84.1%
distribute-neg-in84.1%
remove-double-neg84.1%
unsub-neg84.1%
Simplified84.1%
if 7.50000000000000015e-18 < y Initial program 81.8%
associate-/l/97.3%
Simplified97.3%
Taylor expanded in t around inf 47.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 (<= t -1.4e-250)
(/ (/ x_m y) (- t z))
(if (<= t 0.0012)
(/ x_m (* z (- z y)))
(if (<= t 5.2e+149) (/ x_m (* (- y 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 (t <= -1.4e-250) {
tmp = (x_m / y) / (t - z);
} else if (t <= 0.0012) {
tmp = x_m / (z * (z - y));
} else if (t <= 5.2e+149) {
tmp = x_m / ((y - 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 (t <= (-1.4d-250)) then
tmp = (x_m / y) / (t - z)
else if (t <= 0.0012d0) then
tmp = x_m / (z * (z - y))
else if (t <= 5.2d+149) then
tmp = x_m / ((y - 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 (t <= -1.4e-250) {
tmp = (x_m / y) / (t - z);
} else if (t <= 0.0012) {
tmp = x_m / (z * (z - y));
} else if (t <= 5.2e+149) {
tmp = x_m / ((y - 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 t <= -1.4e-250: tmp = (x_m / y) / (t - z) elif t <= 0.0012: tmp = x_m / (z * (z - y)) elif t <= 5.2e+149: tmp = x_m / ((y - 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 (t <= -1.4e-250) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 0.0012) tmp = Float64(x_m / Float64(z * Float64(z - y))); elseif (t <= 5.2e+149) tmp = Float64(x_m / Float64(Float64(y - 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 (t <= -1.4e-250)
tmp = (x_m / y) / (t - z);
elseif (t <= 0.0012)
tmp = x_m / (z * (z - y));
elseif (t <= 5.2e+149)
tmp = x_m / ((y - 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[t, -1.4e-250], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0012], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e+149], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;t \leq -1.4 \cdot 10^{-250}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 0.0012:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+149}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.40000000000000014e-250Initial program 86.2%
Taylor expanded in y around inf 51.9%
associate-/r*51.8%
Simplified51.8%
if -1.40000000000000014e-250 < t < 0.00119999999999999989Initial program 88.4%
Taylor expanded in t around 0 78.4%
mul-1-neg78.4%
distribute-rgt-neg-in78.4%
neg-sub078.4%
sub-neg78.4%
+-commutative78.4%
associate--r+78.4%
neg-sub078.4%
remove-double-neg78.4%
Simplified78.4%
if 0.00119999999999999989 < t < 5.19999999999999957e149Initial program 96.2%
Taylor expanded in t around inf 83.6%
if 5.19999999999999957e149 < t Initial program 70.0%
associate-/l/97.1%
Simplified97.1%
Taylor expanded in t around inf 91.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 -1.15e-209)
(/ x_m (* y (- t z)))
(if (<= t 0.0039)
(/ x_m (* z (- z y)))
(if (<= t 7.3e+149) (/ x_m (* (- y 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 (t <= -1.15e-209) {
tmp = x_m / (y * (t - z));
} else if (t <= 0.0039) {
tmp = x_m / (z * (z - y));
} else if (t <= 7.3e+149) {
tmp = x_m / ((y - 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 (t <= (-1.15d-209)) then
tmp = x_m / (y * (t - z))
else if (t <= 0.0039d0) then
tmp = x_m / (z * (z - y))
else if (t <= 7.3d+149) then
tmp = x_m / ((y - 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 (t <= -1.15e-209) {
tmp = x_m / (y * (t - z));
} else if (t <= 0.0039) {
tmp = x_m / (z * (z - y));
} else if (t <= 7.3e+149) {
tmp = x_m / ((y - 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 t <= -1.15e-209: tmp = x_m / (y * (t - z)) elif t <= 0.0039: tmp = x_m / (z * (z - y)) elif t <= 7.3e+149: tmp = x_m / ((y - 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 (t <= -1.15e-209) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (t <= 0.0039) tmp = Float64(x_m / Float64(z * Float64(z - y))); elseif (t <= 7.3e+149) tmp = Float64(x_m / Float64(Float64(y - 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 (t <= -1.15e-209)
tmp = x_m / (y * (t - z));
elseif (t <= 0.0039)
tmp = x_m / (z * (z - y));
elseif (t <= 7.3e+149)
tmp = x_m / ((y - 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[t, -1.15e-209], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0039], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.3e+149], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;t \leq -1.15 \cdot 10^{-209}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;t \leq 0.0039:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;t \leq 7.3 \cdot 10^{+149}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.15e-209Initial program 87.4%
clear-num87.3%
associate-/r/87.3%
Applied egg-rr87.3%
associate-*l/87.4%
times-frac95.8%
*-commutative95.8%
clear-num95.6%
associate-*l/96.2%
*-un-lft-identity96.2%
Applied egg-rr96.2%
Taylor expanded in y around inf 53.0%
if -1.15e-209 < t < 0.0038999999999999998Initial program 87.2%
Taylor expanded in t around 0 77.8%
mul-1-neg77.8%
distribute-rgt-neg-in77.8%
neg-sub077.8%
sub-neg77.8%
+-commutative77.8%
associate--r+77.8%
neg-sub077.8%
remove-double-neg77.8%
Simplified77.8%
if 0.0038999999999999998 < t < 7.2999999999999997e149Initial program 96.2%
Taylor expanded in t around inf 83.6%
if 7.2999999999999997e149 < t Initial program 70.0%
associate-/l/97.1%
Simplified97.1%
Taylor expanded in t around inf 91.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 (<= z -1.35e+154)
(/ (/ x_m z) z)
(if (<= z -1.5e-43)
(/ x_m (* z (- z y)))
(if (<= z 4e+120) (/ x_m (* y (- t z))) (* (/ x_m z) (/ 1.0 z)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.35e+154) {
tmp = (x_m / z) / z;
} else if (z <= -1.5e-43) {
tmp = x_m / (z * (z - y));
} else if (z <= 4e+120) {
tmp = x_m / (y * (t - z));
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.35d+154)) then
tmp = (x_m / z) / z
else if (z <= (-1.5d-43)) then
tmp = x_m / (z * (z - y))
else if (z <= 4d+120) then
tmp = x_m / (y * (t - z))
else
tmp = (x_m / z) * (1.0d0 / z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -1.35e+154) {
tmp = (x_m / z) / z;
} else if (z <= -1.5e-43) {
tmp = x_m / (z * (z - y));
} else if (z <= 4e+120) {
tmp = x_m / (y * (t - z));
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -1.35e+154: tmp = (x_m / z) / z elif z <= -1.5e-43: tmp = x_m / (z * (z - y)) elif z <= 4e+120: tmp = x_m / (y * (t - z)) else: tmp = (x_m / z) * (1.0 / z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -1.35e+154) tmp = Float64(Float64(x_m / z) / z); elseif (z <= -1.5e-43) tmp = Float64(x_m / Float64(z * Float64(z - y))); elseif (z <= 4e+120) tmp = Float64(x_m / Float64(y * Float64(t - z))); else tmp = Float64(Float64(x_m / z) * Float64(1.0 / z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (z <= -1.35e+154)
tmp = (x_m / z) / z;
elseif (z <= -1.5e-43)
tmp = x_m / (z * (z - y));
elseif (z <= 4e+120)
tmp = x_m / (y * (t - z));
else
tmp = (x_m / z) * (1.0 / 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[z, -1.35e+154], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -1.5e-43], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+120], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / 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}\;z \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+120}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
if z < -1.35000000000000003e154Initial program 68.6%
Taylor expanded in t around 0 68.6%
mul-1-neg68.6%
associate-/r*96.9%
distribute-neg-frac296.9%
neg-sub096.9%
sub-neg96.9%
+-commutative96.9%
associate--r+96.9%
neg-sub096.9%
remove-double-neg96.9%
Simplified96.9%
Taylor expanded in z around inf 92.1%
if -1.35000000000000003e154 < z < -1.50000000000000002e-43Initial program 92.3%
Taylor expanded in t around 0 70.4%
mul-1-neg70.4%
distribute-rgt-neg-in70.4%
neg-sub070.4%
sub-neg70.4%
+-commutative70.4%
associate--r+70.4%
neg-sub070.4%
remove-double-neg70.4%
Simplified70.4%
if -1.50000000000000002e-43 < z < 3.9999999999999999e120Initial program 92.1%
clear-num91.1%
associate-/r/91.9%
Applied egg-rr91.9%
associate-*l/92.1%
times-frac93.4%
*-commutative93.4%
clear-num93.0%
associate-*l/93.2%
*-un-lft-identity93.2%
Applied egg-rr93.2%
Taylor expanded in y around inf 76.9%
if 3.9999999999999999e120 < z Initial program 69.5%
Taylor expanded in t around 0 69.3%
mul-1-neg69.3%
distribute-rgt-neg-in69.3%
neg-sub069.3%
sub-neg69.3%
+-commutative69.3%
associate--r+69.3%
neg-sub069.3%
remove-double-neg69.3%
Simplified69.3%
Taylor expanded in z around inf 69.2%
associate-/r*87.8%
div-inv87.9%
Applied egg-rr87.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 (<= z -12000000.0)
(/ (/ x_m z) z)
(if (<= z 2.06e+21)
(/ (/ x_m y) t)
(if (<= z 4.3e+120) (/ (/ x_m z) (- t)) (* (/ x_m z) (/ 1.0 z)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -12000000.0) {
tmp = (x_m / z) / z;
} else if (z <= 2.06e+21) {
tmp = (x_m / y) / t;
} else if (z <= 4.3e+120) {
tmp = (x_m / z) / -t;
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-12000000.0d0)) then
tmp = (x_m / z) / z
else if (z <= 2.06d+21) then
tmp = (x_m / y) / t
else if (z <= 4.3d+120) then
tmp = (x_m / z) / -t
else
tmp = (x_m / z) * (1.0d0 / z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -12000000.0) {
tmp = (x_m / z) / z;
} else if (z <= 2.06e+21) {
tmp = (x_m / y) / t;
} else if (z <= 4.3e+120) {
tmp = (x_m / z) / -t;
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -12000000.0: tmp = (x_m / z) / z elif z <= 2.06e+21: tmp = (x_m / y) / t elif z <= 4.3e+120: tmp = (x_m / z) / -t else: tmp = (x_m / z) * (1.0 / z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -12000000.0) tmp = Float64(Float64(x_m / z) / z); elseif (z <= 2.06e+21) tmp = Float64(Float64(x_m / y) / t); elseif (z <= 4.3e+120) tmp = Float64(Float64(x_m / z) / Float64(-t)); else tmp = Float64(Float64(x_m / z) * Float64(1.0 / z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (z <= -12000000.0)
tmp = (x_m / z) / z;
elseif (z <= 2.06e+21)
tmp = (x_m / y) / t;
elseif (z <= 4.3e+120)
tmp = (x_m / z) / -t;
else
tmp = (x_m / z) * (1.0 / 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[z, -12000000.0], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.06e+21], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 4.3e+120], N[(N[(x$95$m / z), $MachinePrecision] / (-t)), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / 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}\;z \leq -12000000:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{elif}\;z \leq 2.06 \cdot 10^{+21}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+120}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
if z < -1.2e7Initial program 82.3%
Taylor expanded in t around 0 71.9%
mul-1-neg71.9%
associate-/r*85.4%
distribute-neg-frac285.4%
neg-sub085.4%
sub-neg85.4%
+-commutative85.4%
associate--r+85.4%
neg-sub085.4%
remove-double-neg85.4%
Simplified85.4%
Taylor expanded in z around inf 78.0%
if -1.2e7 < z < 2.06e21Initial program 94.6%
Taylor expanded in y around inf 77.1%
associate-/r*79.2%
Simplified79.2%
Taylor expanded in t around inf 60.3%
if 2.06e21 < z < 4.3000000000000002e120Initial program 74.5%
Taylor expanded in y around 0 39.7%
mul-1-neg39.7%
associate-/r*39.9%
distribute-neg-frac239.9%
sub-neg39.9%
+-commutative39.9%
distribute-neg-in39.9%
remove-double-neg39.9%
unsub-neg39.9%
Simplified39.9%
Taylor expanded in z around 0 34.3%
neg-mul-134.3%
Simplified34.3%
if 4.3000000000000002e120 < z Initial program 69.5%
Taylor expanded in t around 0 69.3%
mul-1-neg69.3%
distribute-rgt-neg-in69.3%
neg-sub069.3%
sub-neg69.3%
+-commutative69.3%
associate--r+69.3%
neg-sub069.3%
remove-double-neg69.3%
Simplified69.3%
Taylor expanded in z around inf 69.2%
associate-/r*87.8%
div-inv87.9%
Applied egg-rr87.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
(let* ((t_1 (/ (/ x_m z) z)))
(*
x_s
(if (<= z -3700000.0)
t_1
(if (<= z 3.25e+19)
(/ (/ x_m y) t)
(if (<= z 4e+120) (/ (/ x_m z) (- t)) t_1))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) / z;
double tmp;
if (z <= -3700000.0) {
tmp = t_1;
} else if (z <= 3.25e+19) {
tmp = (x_m / y) / t;
} else if (z <= 4e+120) {
tmp = (x_m / z) / -t;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x_m / z) / z
if (z <= (-3700000.0d0)) then
tmp = t_1
else if (z <= 3.25d+19) then
tmp = (x_m / y) / t
else if (z <= 4d+120) then
tmp = (x_m / z) / -t
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) / z;
double tmp;
if (z <= -3700000.0) {
tmp = t_1;
} else if (z <= 3.25e+19) {
tmp = (x_m / y) / t;
} else if (z <= 4e+120) {
tmp = (x_m / z) / -t;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = (x_m / z) / z tmp = 0 if z <= -3700000.0: tmp = t_1 elif z <= 3.25e+19: tmp = (x_m / y) / t elif z <= 4e+120: tmp = (x_m / z) / -t else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / z) / z) tmp = 0.0 if (z <= -3700000.0) tmp = t_1; elseif (z <= 3.25e+19) tmp = Float64(Float64(x_m / y) / t); elseif (z <= 4e+120) tmp = Float64(Float64(x_m / z) / Float64(-t)); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = (x_m / z) / z;
tmp = 0.0;
if (z <= -3700000.0)
tmp = t_1;
elseif (z <= 3.25e+19)
tmp = (x_m / y) / t;
elseif (z <= 4e+120)
tmp = (x_m / z) / -t;
else
tmp = t_1;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3700000.0], t$95$1, If[LessEqual[z, 3.25e+19], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 4e+120], N[(N[(x$95$m / z), $MachinePrecision] / (-t)), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3700000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+120}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{-t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -3.7e6 or 3.9999999999999999e120 < z Initial program 77.6%
Taylor expanded in t around 0 71.0%
mul-1-neg71.0%
associate-/r*88.0%
distribute-neg-frac288.0%
neg-sub088.0%
sub-neg88.0%
+-commutative88.0%
associate--r+88.0%
neg-sub088.0%
remove-double-neg88.0%
Simplified88.0%
Taylor expanded in z around inf 81.6%
if -3.7e6 < z < 3.25e19Initial program 94.6%
Taylor expanded in y around inf 77.1%
associate-/r*79.2%
Simplified79.2%
Taylor expanded in t around inf 60.3%
if 3.25e19 < z < 3.9999999999999999e120Initial program 74.5%
Taylor expanded in y around 0 39.7%
mul-1-neg39.7%
associate-/r*39.9%
distribute-neg-frac239.9%
sub-neg39.9%
+-commutative39.9%
distribute-neg-in39.9%
remove-double-neg39.9%
unsub-neg39.9%
Simplified39.9%
Taylor expanded in z around 0 34.3%
neg-mul-134.3%
Simplified34.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 (<= t -1.12e-209)
(/ x_m (* y (- t z)))
(if (<= t 0.0019) (/ x_m (* z (- z y))) (/ x_m (* (- y z) t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -1.12e-209) {
tmp = x_m / (y * (t - z));
} else if (t <= 0.0019) {
tmp = x_m / (z * (z - y));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.12d-209)) then
tmp = x_m / (y * (t - z))
else if (t <= 0.0019d0) then
tmp = x_m / (z * (z - y))
else
tmp = x_m / ((y - z) * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -1.12e-209) {
tmp = x_m / (y * (t - z));
} else if (t <= 0.0019) {
tmp = x_m / (z * (z - y));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -1.12e-209: tmp = x_m / (y * (t - z)) elif t <= 0.0019: tmp = x_m / (z * (z - y)) else: tmp = x_m / ((y - z) * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -1.12e-209) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (t <= 0.0019) tmp = Float64(x_m / Float64(z * Float64(z - y))); else tmp = Float64(x_m / Float64(Float64(y - z) * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= -1.12e-209)
tmp = x_m / (y * (t - z));
elseif (t <= 0.0019)
tmp = x_m / (z * (z - y));
else
tmp = x_m / ((y - z) * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -1.12e-209], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0019], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{-209}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;t \leq 0.0019:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.12e-209Initial program 87.4%
clear-num87.3%
associate-/r/87.3%
Applied egg-rr87.3%
associate-*l/87.4%
times-frac95.8%
*-commutative95.8%
clear-num95.6%
associate-*l/96.2%
*-un-lft-identity96.2%
Applied egg-rr96.2%
Taylor expanded in y around inf 53.0%
if -1.12e-209 < t < 0.0019Initial program 87.2%
Taylor expanded in t around 0 77.8%
mul-1-neg77.8%
distribute-rgt-neg-in77.8%
neg-sub077.8%
sub-neg77.8%
+-commutative77.8%
associate--r+77.8%
neg-sub077.8%
remove-double-neg77.8%
Simplified77.8%
if 0.0019 < t Initial program 81.2%
Taylor expanded in t around inf 75.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 (<= z -48000000000000.0)
(/ (/ x_m z) z)
(if (<= z 5.5e+120) (/ x_m (* y (- t z))) (* (/ x_m z) (/ 1.0 z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -48000000000000.0) {
tmp = (x_m / z) / z;
} else if (z <= 5.5e+120) {
tmp = x_m / (y * (t - z));
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-48000000000000.0d0)) then
tmp = (x_m / z) / z
else if (z <= 5.5d+120) then
tmp = x_m / (y * (t - z))
else
tmp = (x_m / z) * (1.0d0 / z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= -48000000000000.0) {
tmp = (x_m / z) / z;
} else if (z <= 5.5e+120) {
tmp = x_m / (y * (t - z));
} else {
tmp = (x_m / z) * (1.0 / z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if z <= -48000000000000.0: tmp = (x_m / z) / z elif z <= 5.5e+120: tmp = x_m / (y * (t - z)) else: tmp = (x_m / z) * (1.0 / z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= -48000000000000.0) tmp = Float64(Float64(x_m / z) / z); elseif (z <= 5.5e+120) tmp = Float64(x_m / Float64(y * Float64(t - z))); else tmp = Float64(Float64(x_m / z) * Float64(1.0 / z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (z <= -48000000000000.0)
tmp = (x_m / z) / z;
elseif (z <= 5.5e+120)
tmp = x_m / (y * (t - z));
else
tmp = (x_m / z) * (1.0 / 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[z, -48000000000000.0], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 5.5e+120], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / 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}\;z \leq -48000000000000:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+120}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
if z < -4.8e13Initial program 81.5%
Taylor expanded in t around 0 72.1%
mul-1-neg72.1%
associate-/r*86.3%
distribute-neg-frac286.3%
neg-sub086.3%
sub-neg86.3%
+-commutative86.3%
associate--r+86.3%
neg-sub086.3%
remove-double-neg86.3%
Simplified86.3%
Taylor expanded in z around inf 80.0%
if -4.8e13 < z < 5.50000000000000003e120Initial program 92.1%
clear-num91.2%
associate-/r/92.0%
Applied egg-rr92.0%
associate-*l/92.1%
times-frac94.0%
*-commutative94.0%
clear-num93.6%
associate-*l/93.8%
*-un-lft-identity93.8%
Applied egg-rr93.8%
Taylor expanded in y around inf 73.4%
if 5.50000000000000003e120 < z Initial program 69.5%
Taylor expanded in t around 0 69.3%
mul-1-neg69.3%
distribute-rgt-neg-in69.3%
neg-sub069.3%
sub-neg69.3%
+-commutative69.3%
associate--r+69.3%
neg-sub069.3%
remove-double-neg69.3%
Simplified69.3%
Taylor expanded in z around inf 69.2%
associate-/r*87.8%
div-inv87.9%
Applied egg-rr87.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 -3100000.0) (not (<= z 4e+120)))
(/ (/ x_m z) z)
(/ (/ x_m y) t))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -3100000.0) || !(z <= 4e+120)) {
tmp = (x_m / z) / z;
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3100000.0d0)) .or. (.not. (z <= 4d+120))) then
tmp = (x_m / z) / z
else
tmp = (x_m / y) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -3100000.0) || !(z <= 4e+120)) {
tmp = (x_m / z) / z;
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -3100000.0) or not (z <= 4e+120): tmp = (x_m / z) / z else: tmp = (x_m / y) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -3100000.0) || !(z <= 4e+120)) tmp = Float64(Float64(x_m / z) / z); else tmp = Float64(Float64(x_m / y) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -3100000.0) || ~((z <= 4e+120)))
tmp = (x_m / z) / z;
else
tmp = (x_m / y) / t;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -3100000.0], N[Not[LessEqual[z, 4e+120]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / z), $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 -3100000 \lor \neg \left(z \leq 4 \cdot 10^{+120}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if z < -3.1e6 or 3.9999999999999999e120 < z Initial program 77.6%
Taylor expanded in t around 0 71.0%
mul-1-neg71.0%
associate-/r*88.0%
distribute-neg-frac288.0%
neg-sub088.0%
sub-neg88.0%
+-commutative88.0%
associate--r+88.0%
neg-sub088.0%
remove-double-neg88.0%
Simplified88.0%
Taylor expanded in z around inf 81.6%
if -3.1e6 < z < 3.9999999999999999e120Initial program 92.0%
Taylor expanded in y around inf 74.2%
associate-/r*78.6%
Simplified78.6%
Taylor expanded in t around inf 57.6%
Final simplification67.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 -24000000.0) (not (<= z 4e+120)))
(/ x_m (* z z))
(/ (/ x_m y) t))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -24000000.0) || !(z <= 4e+120)) {
tmp = x_m / (z * z);
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-24000000.0d0)) .or. (.not. (z <= 4d+120))) then
tmp = x_m / (z * z)
else
tmp = (x_m / y) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -24000000.0) || !(z <= 4e+120)) {
tmp = x_m / (z * z);
} else {
tmp = (x_m / y) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -24000000.0) or not (z <= 4e+120): tmp = x_m / (z * z) else: tmp = (x_m / y) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -24000000.0) || !(z <= 4e+120)) tmp = Float64(x_m / Float64(z * z)); else tmp = Float64(Float64(x_m / y) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -24000000.0) || ~((z <= 4e+120)))
tmp = x_m / (z * z);
else
tmp = (x_m / y) / t;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -24000000.0], N[Not[LessEqual[z, 4e+120]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -24000000 \lor \neg \left(z \leq 4 \cdot 10^{+120}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\end{array}
\end{array}
if z < -2.4e7 or 3.9999999999999999e120 < z Initial program 77.6%
Taylor expanded in t around 0 71.0%
mul-1-neg71.0%
distribute-rgt-neg-in71.0%
neg-sub071.0%
sub-neg71.0%
+-commutative71.0%
associate--r+71.0%
neg-sub071.0%
remove-double-neg71.0%
Simplified71.0%
Taylor expanded in z around inf 68.4%
if -2.4e7 < z < 3.9999999999999999e120Initial program 92.0%
Taylor expanded in y around inf 74.2%
associate-/r*78.6%
Simplified78.6%
Taylor expanded in t around inf 57.6%
Final simplification62.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -400000.0) (not (<= z 4e+120)))
(/ x_m (* z 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 <= -400000.0) || !(z <= 4e+120)) {
tmp = x_m / (z * 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 <= (-400000.0d0)) .or. (.not. (z <= 4d+120))) then
tmp = x_m / (z * 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 <= -400000.0) || !(z <= 4e+120)) {
tmp = x_m / (z * 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 <= -400000.0) or not (z <= 4e+120): tmp = x_m / (z * 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 <= -400000.0) || !(z <= 4e+120)) tmp = Float64(x_m / Float64(z * 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 <= -400000.0) || ~((z <= 4e+120)))
tmp = x_m / (z * 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, -400000.0], N[Not[LessEqual[z, 4e+120]], $MachinePrecision]], N[(x$95$m / N[(z * 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 -400000 \lor \neg \left(z \leq 4 \cdot 10^{+120}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -4e5 or 3.9999999999999999e120 < z Initial program 77.6%
Taylor expanded in t around 0 71.0%
mul-1-neg71.0%
distribute-rgt-neg-in71.0%
neg-sub071.0%
sub-neg71.0%
+-commutative71.0%
associate--r+71.0%
neg-sub071.0%
remove-double-neg71.0%
Simplified71.0%
Taylor expanded in z around inf 68.4%
if -4e5 < z < 3.9999999999999999e120Initial program 92.0%
clear-num91.0%
associate-/r/91.9%
Applied egg-rr91.9%
associate-*l/92.0%
times-frac93.9%
*-commutative93.9%
clear-num93.5%
associate-*l/93.7%
*-un-lft-identity93.7%
Applied egg-rr93.7%
Taylor expanded in z around 0 52.0%
associate-/r*54.4%
Simplified54.4%
Final simplification60.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 (<= z -1.7e-43) (not (<= z 4e+120)))
(/ x_m (* z z))
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.7e-43) || !(z <= 4e+120)) {
tmp = x_m / (z * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.7d-43)) .or. (.not. (z <= 4d+120))) then
tmp = x_m / (z * z)
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.7e-43) || !(z <= 4e+120)) {
tmp = x_m / (z * z);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -1.7e-43) or not (z <= 4e+120): tmp = x_m / (z * z) else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -1.7e-43) || !(z <= 4e+120)) tmp = Float64(x_m / Float64(z * z)); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -1.7e-43) || ~((z <= 4e+120)))
tmp = x_m / (z * z);
else
tmp = x_m / (y * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.7e-43], N[Not[LessEqual[z, 4e+120]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-43} \lor \neg \left(z \leq 4 \cdot 10^{+120}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.7e-43 or 3.9999999999999999e120 < z Initial program 78.9%
Taylor expanded in t around 0 69.6%
mul-1-neg69.6%
distribute-rgt-neg-in69.6%
neg-sub069.6%
sub-neg69.6%
+-commutative69.6%
associate--r+69.6%
neg-sub069.6%
remove-double-neg69.6%
Simplified69.6%
Taylor expanded in z around inf 64.8%
if -1.7e-43 < z < 3.9999999999999999e120Initial program 92.1%
Taylor expanded in z around 0 54.4%
Final simplification59.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 (/ 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 85.8%
Taylor expanded in z around 0 35.1%
Final simplification35.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 2024172
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))
(/ x (* (- y z) (- t z))))