
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (/ x_m (* (- y z) (- t z))))) (* x_s (if (<= t_1 -2.5e-305) t_1 (/ (/ 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 t_1 = x_m / ((y - z) * (t - z));
double tmp;
if (t_1 <= -2.5e-305) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x_m / ((y - z) * (t - z))
if (t_1 <= (-2.5d-305)) then
tmp = t_1
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 t_1 = x_m / ((y - z) * (t - z));
double tmp;
if (t_1 <= -2.5e-305) {
tmp = t_1;
} 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): t_1 = x_m / ((y - z) * (t - z)) tmp = 0 if t_1 <= -2.5e-305: tmp = t_1 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) t_1 = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= -2.5e-305) tmp = t_1; else tmp = Float64(Float64(x_m / 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)
t_1 = x_m / ((y - z) * (t - z));
tmp = 0.0;
if (t_1 <= -2.5e-305)
tmp = t_1;
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_] := 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, -2.5e-305], t$95$1, N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\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.5 \cdot 10^{-305}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t - z}\\
\end{array}
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -2.49999999999999993e-305Initial program 98.0%
if -2.49999999999999993e-305 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 85.8%
Taylor expanded in x around 0 85.8%
associate-/l/96.6%
Simplified96.6%
Final simplification96.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 t))))
(*
x_s
(if (<= y -2.3e-38)
(/ (/ x_m y) (- t z))
(if (<= y 4.2e-175)
t_1
(if (<= y 1.45e-59)
(/ (/ x_m (- y z)) t)
(if (<= y 4e-27)
t_1
(if (<= y 1.15e+127)
(/ 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 t_1 = (x_m / z) / (z - t);
double tmp;
if (y <= -2.3e-38) {
tmp = (x_m / y) / (t - z);
} else if (y <= 4.2e-175) {
tmp = t_1;
} else if (y <= 1.45e-59) {
tmp = (x_m / (y - z)) / t;
} else if (y <= 4e-27) {
tmp = t_1;
} else if (y <= 1.15e+127) {
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) :: t_1
real(8) :: tmp
t_1 = (x_m / z) / (z - t)
if (y <= (-2.3d-38)) then
tmp = (x_m / y) / (t - z)
else if (y <= 4.2d-175) then
tmp = t_1
else if (y <= 1.45d-59) then
tmp = (x_m / (y - z)) / t
else if (y <= 4d-27) then
tmp = t_1
else if (y <= 1.15d+127) 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 t_1 = (x_m / z) / (z - t);
double tmp;
if (y <= -2.3e-38) {
tmp = (x_m / y) / (t - z);
} else if (y <= 4.2e-175) {
tmp = t_1;
} else if (y <= 1.45e-59) {
tmp = (x_m / (y - z)) / t;
} else if (y <= 4e-27) {
tmp = t_1;
} else if (y <= 1.15e+127) {
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): t_1 = (x_m / z) / (z - t) tmp = 0 if y <= -2.3e-38: tmp = (x_m / y) / (t - z) elif y <= 4.2e-175: tmp = t_1 elif y <= 1.45e-59: tmp = (x_m / (y - z)) / t elif y <= 4e-27: tmp = t_1 elif y <= 1.15e+127: 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) t_1 = Float64(Float64(x_m / z) / Float64(z - t)) tmp = 0.0 if (y <= -2.3e-38) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 4.2e-175) tmp = t_1; elseif (y <= 1.45e-59) tmp = Float64(Float64(x_m / Float64(y - z)) / t); elseif (y <= 4e-27) tmp = t_1; elseif (y <= 1.15e+127) 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)
t_1 = (x_m / z) / (z - t);
tmp = 0.0;
if (y <= -2.3e-38)
tmp = (x_m / y) / (t - z);
elseif (y <= 4.2e-175)
tmp = t_1;
elseif (y <= 1.45e-59)
tmp = (x_m / (y - z)) / t;
elseif (y <= 4e-27)
tmp = t_1;
elseif (y <= 1.15e+127)
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_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -2.3e-38], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-175], t$95$1, If[LessEqual[y, 1.45e-59], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 4e-27], t$95$1, If[LessEqual[y, 1.15e+127], 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])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{z}}{z - t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-175}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-59}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+127}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
\end{array}
if y < -2.30000000000000002e-38Initial program 86.8%
Taylor expanded in x around 0 86.8%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in y around inf 84.0%
if -2.30000000000000002e-38 < y < 4.2e-175 or 1.45000000000000008e-59 < y < 4.0000000000000002e-27Initial program 91.6%
Taylor expanded in x around 0 91.6%
associate-/l/93.2%
Simplified93.2%
Taylor expanded in y around 0 79.3%
associate-*r/79.3%
mul-1-neg79.3%
Simplified79.3%
if 4.2e-175 < y < 1.45000000000000008e-59Initial program 99.8%
associate-/r*99.9%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 89.5%
un-div-inv89.5%
Applied egg-rr89.5%
if 4.0000000000000002e-27 < y < 1.1500000000000001e127Initial program 89.7%
Taylor expanded in t around inf 67.3%
if 1.1500000000000001e127 < y Initial program 72.9%
associate-/l/99.6%
Simplified99.6%
Taylor expanded in t around inf 70.0%
Final simplification79.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -4.5e-43)
(/ (/ x_m y) (- t z))
(if (<= y 8.2e-175)
(/ (/ x_m z) (- z t))
(if (<= y 1.35e-59)
(/ (/ x_m (- y z)) t)
(if (<= y 1.9e-21)
(* (/ x_m (- t z)) (/ -1.0 z))
(if (<= y 9e+106) (/ 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 (y <= -4.5e-43) {
tmp = (x_m / y) / (t - z);
} else if (y <= 8.2e-175) {
tmp = (x_m / z) / (z - t);
} else if (y <= 1.35e-59) {
tmp = (x_m / (y - z)) / t;
} else if (y <= 1.9e-21) {
tmp = (x_m / (t - z)) * (-1.0 / z);
} else if (y <= 9e+106) {
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 (y <= (-4.5d-43)) then
tmp = (x_m / y) / (t - z)
else if (y <= 8.2d-175) then
tmp = (x_m / z) / (z - t)
else if (y <= 1.35d-59) then
tmp = (x_m / (y - z)) / t
else if (y <= 1.9d-21) then
tmp = (x_m / (t - z)) * ((-1.0d0) / z)
else if (y <= 9d+106) 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 (y <= -4.5e-43) {
tmp = (x_m / y) / (t - z);
} else if (y <= 8.2e-175) {
tmp = (x_m / z) / (z - t);
} else if (y <= 1.35e-59) {
tmp = (x_m / (y - z)) / t;
} else if (y <= 1.9e-21) {
tmp = (x_m / (t - z)) * (-1.0 / z);
} else if (y <= 9e+106) {
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 y <= -4.5e-43: tmp = (x_m / y) / (t - z) elif y <= 8.2e-175: tmp = (x_m / z) / (z - t) elif y <= 1.35e-59: tmp = (x_m / (y - z)) / t elif y <= 1.9e-21: tmp = (x_m / (t - z)) * (-1.0 / z) elif y <= 9e+106: 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 (y <= -4.5e-43) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 8.2e-175) tmp = Float64(Float64(x_m / z) / Float64(z - t)); elseif (y <= 1.35e-59) tmp = Float64(Float64(x_m / Float64(y - z)) / t); elseif (y <= 1.9e-21) tmp = Float64(Float64(x_m / Float64(t - z)) * Float64(-1.0 / z)); elseif (y <= 9e+106) 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 (y <= -4.5e-43)
tmp = (x_m / y) / (t - z);
elseif (y <= 8.2e-175)
tmp = (x_m / z) / (z - t);
elseif (y <= 1.35e-59)
tmp = (x_m / (y - z)) / t;
elseif (y <= 1.9e-21)
tmp = (x_m / (t - z)) * (-1.0 / z);
elseif (y <= 9e+106)
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[y, -4.5e-43], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-175], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-59], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 1.9e-21], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+106], 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}\;y \leq -4.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-175}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-59}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-21}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot \frac{-1}{z}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+106}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -4.50000000000000025e-43Initial program 86.9%
Taylor expanded in x around 0 86.9%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in y around inf 84.2%
if -4.50000000000000025e-43 < y < 8.19999999999999997e-175Initial program 91.3%
Taylor expanded in x around 0 91.3%
associate-/l/91.9%
Simplified91.9%
Taylor expanded in y around 0 82.1%
associate-*r/82.1%
mul-1-neg82.1%
Simplified82.1%
if 8.19999999999999997e-175 < y < 1.3499999999999999e-59Initial program 99.8%
associate-/r*99.9%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 89.5%
un-div-inv89.5%
Applied egg-rr89.5%
if 1.3499999999999999e-59 < y < 1.8999999999999999e-21Initial program 92.9%
associate-/l/99.9%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 72.2%
if 1.8999999999999999e-21 < y < 8.9999999999999994e106Initial program 90.6%
Taylor expanded in t around inf 69.6%
if 8.9999999999999994e106 < y Initial program 74.8%
associate-/l/99.6%
Simplified99.6%
Taylor expanded in t around inf 72.4%
Final simplification80.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
(let* ((t_1 (* (- y z) (- t z))))
(*
x_s
(if (or (<= t_1 -1e+95) (not (<= t_1 5e+123)))
(/ (/ x_m (- t z)) (- y z))
(/ x_m 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 = (y - z) * (t - z);
double tmp;
if ((t_1 <= -1e+95) || !(t_1 <= 5e+123)) {
tmp = (x_m / (t - z)) / (y - z);
} else {
tmp = x_m / 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 = (y - z) * (t - z)
if ((t_1 <= (-1d+95)) .or. (.not. (t_1 <= 5d+123))) then
tmp = (x_m / (t - z)) / (y - z)
else
tmp = x_m / 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 = (y - z) * (t - z);
double tmp;
if ((t_1 <= -1e+95) || !(t_1 <= 5e+123)) {
tmp = (x_m / (t - z)) / (y - z);
} else {
tmp = x_m / 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 = (y - z) * (t - z) tmp = 0 if (t_1 <= -1e+95) or not (t_1 <= 5e+123): tmp = (x_m / (t - z)) / (y - z) else: tmp = x_m / 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(y - z) * Float64(t - z)) tmp = 0.0 if ((t_1 <= -1e+95) || !(t_1 <= 5e+123)) tmp = Float64(Float64(x_m / Float64(t - z)) / Float64(y - z)); else tmp = Float64(x_m / 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 = (y - z) * (t - z);
tmp = 0.0;
if ((t_1 <= -1e+95) || ~((t_1 <= 5e+123)))
tmp = (x_m / (t - z)) / (y - z);
else
tmp = x_m / 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[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[Or[LessEqual[t$95$1, -1e+95], N[Not[LessEqual[t$95$1, 5e+123]], $MachinePrecision]], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / t$95$1), $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 := \left(y - z\right) \cdot \left(t - z\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+95} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+123}\right):\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{t\_1}\\
\end{array}
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -1.00000000000000002e95 or 4.99999999999999974e123 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 83.8%
associate-/l/99.3%
Simplified99.3%
if -1.00000000000000002e95 < (*.f64 (-.f64 y z) (-.f64 t z)) < 4.99999999999999974e123Initial program 98.1%
Final simplification98.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 t) y)))
(*
x_s
(if (<= t -0.00082)
t_1
(if (<= t 1.4e-109)
(/ x_m (* z (- y)))
(if (or (<= t 7.8e+39) (not (<= t 1.02e+104)))
t_1
(/ x_m (* 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 t_1 = (x_m / t) / y;
double tmp;
if (t <= -0.00082) {
tmp = t_1;
} else if (t <= 1.4e-109) {
tmp = x_m / (z * -y);
} else if ((t <= 7.8e+39) || !(t <= 1.02e+104)) {
tmp = t_1;
} else {
tmp = x_m / (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) :: t_1
real(8) :: tmp
t_1 = (x_m / t) / y
if (t <= (-0.00082d0)) then
tmp = t_1
else if (t <= 1.4d-109) then
tmp = x_m / (z * -y)
else if ((t <= 7.8d+39) .or. (.not. (t <= 1.02d+104))) then
tmp = t_1
else
tmp = x_m / (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 t_1 = (x_m / t) / y;
double tmp;
if (t <= -0.00082) {
tmp = t_1;
} else if (t <= 1.4e-109) {
tmp = x_m / (z * -y);
} else if ((t <= 7.8e+39) || !(t <= 1.02e+104)) {
tmp = t_1;
} else {
tmp = x_m / (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): t_1 = (x_m / t) / y tmp = 0 if t <= -0.00082: tmp = t_1 elif t <= 1.4e-109: tmp = x_m / (z * -y) elif (t <= 7.8e+39) or not (t <= 1.02e+104): tmp = t_1 else: tmp = x_m / (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) t_1 = Float64(Float64(x_m / t) / y) tmp = 0.0 if (t <= -0.00082) tmp = t_1; elseif (t <= 1.4e-109) tmp = Float64(x_m / Float64(z * Float64(-y))); elseif ((t <= 7.8e+39) || !(t <= 1.02e+104)) tmp = t_1; else tmp = Float64(x_m / Float64(z * Float64(-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)
t_1 = (x_m / t) / y;
tmp = 0.0;
if (t <= -0.00082)
tmp = t_1;
elseif (t <= 1.4e-109)
tmp = x_m / (z * -y);
elseif ((t <= 7.8e+39) || ~((t <= 1.02e+104)))
tmp = t_1;
else
tmp = x_m / (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_] := Block[{t$95$1 = N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -0.00082], t$95$1, If[LessEqual[t, 1.4e-109], N[(x$95$m / N[(z * (-y)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 7.8e+39], N[Not[LessEqual[t, 1.02e+104]], $MachinePrecision]], t$95$1, N[(x$95$m / N[(z * (-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])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{t}}{y}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -0.00082:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-109}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-y\right)}\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+39} \lor \neg \left(t \leq 1.02 \cdot 10^{+104}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-t\right)}\\
\end{array}
\end{array}
\end{array}
if t < -8.1999999999999998e-4 or 1.39999999999999989e-109 < t < 7.8000000000000002e39 or 1.02e104 < t Initial program 85.7%
Taylor expanded in z around 0 48.8%
associate-/r*57.5%
div-inv57.6%
Applied egg-rr57.6%
un-div-inv57.5%
Applied egg-rr57.5%
if -8.1999999999999998e-4 < t < 1.39999999999999989e-109Initial program 92.2%
associate-/l/96.4%
Simplified96.4%
Taylor expanded in t around 0 76.3%
associate-*r/76.3%
neg-mul-176.3%
Simplified76.3%
Taylor expanded in z around 0 46.8%
associate-*r/46.8%
mul-1-neg46.8%
*-commutative46.8%
Simplified46.8%
if 7.8000000000000002e39 < t < 1.02e104Initial program 90.2%
associate-/l/91.1%
Simplified91.1%
Taylor expanded in t around inf 62.4%
Taylor expanded in y around 0 57.1%
associate-*r/57.1%
mul-1-neg57.1%
Simplified57.1%
Final simplification53.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* (/ x_m z) (/ 1.0 z))))
(*
x_s
(if (<= z -2e+43)
t_1
(if (<= z 1.15e-83)
(/ (/ x_m t) y)
(if (<= z 4.3e+41) (/ (/ x_m y) (- z)) t_1))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) * (1.0 / z);
double tmp;
if (z <= -2e+43) {
tmp = t_1;
} else if (z <= 1.15e-83) {
tmp = (x_m / t) / y;
} else if (z <= 4.3e+41) {
tmp = (x_m / y) / -z;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x_m / z) * (1.0d0 / z)
if (z <= (-2d+43)) then
tmp = t_1
else if (z <= 1.15d-83) then
tmp = (x_m / t) / y
else if (z <= 4.3d+41) then
tmp = (x_m / y) / -z
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) * (1.0 / z);
double tmp;
if (z <= -2e+43) {
tmp = t_1;
} else if (z <= 1.15e-83) {
tmp = (x_m / t) / y;
} else if (z <= 4.3e+41) {
tmp = (x_m / y) / -z;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = (x_m / z) * (1.0 / z) tmp = 0 if z <= -2e+43: tmp = t_1 elif z <= 1.15e-83: tmp = (x_m / t) / y elif z <= 4.3e+41: tmp = (x_m / y) / -z else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / z) * Float64(1.0 / z)) tmp = 0.0 if (z <= -2e+43) tmp = t_1; elseif (z <= 1.15e-83) tmp = Float64(Float64(x_m / t) / y); elseif (z <= 4.3e+41) tmp = Float64(Float64(x_m / y) / Float64(-z)); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = (x_m / z) * (1.0 / z);
tmp = 0.0;
if (z <= -2e+43)
tmp = t_1;
elseif (z <= 1.15e-83)
tmp = (x_m / t) / y;
elseif (z <= 4.3e+41)
tmp = (x_m / y) / -z;
else
tmp = t_1;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -2e+43], t$95$1, If[LessEqual[z, 1.15e-83], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 4.3e+41], N[(N[(x$95$m / y), $MachinePrecision] / (-z)), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z} \cdot \frac{1}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-83}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+41}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{-z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -2.00000000000000003e43 or 4.30000000000000024e41 < z Initial program 83.4%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 83.9%
associate-*r/83.9%
neg-mul-183.9%
Simplified83.9%
div-inv83.9%
add-sqr-sqrt36.8%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod30.3%
add-sqr-sqrt55.9%
sub-neg55.9%
add-sqr-sqrt30.5%
sqrt-unprod62.1%
sqr-neg62.1%
sqrt-unprod36.6%
add-sqr-sqrt76.1%
Applied egg-rr76.1%
Taylor expanded in y around 0 74.4%
if -2.00000000000000003e43 < z < 1.14999999999999995e-83Initial program 90.4%
Taylor expanded in z around 0 62.9%
associate-/r*71.7%
div-inv71.7%
Applied egg-rr71.7%
un-div-inv71.7%
Applied egg-rr71.7%
if 1.14999999999999995e-83 < z < 4.30000000000000024e41Initial program 99.5%
associate-/l/86.1%
Simplified86.1%
Taylor expanded in t around 0 44.5%
associate-*r/44.5%
neg-mul-144.5%
Simplified44.5%
Taylor expanded in z around 0 36.7%
associate-*r/36.7%
mul-1-neg36.7%
*-commutative36.7%
Simplified36.7%
Taylor expanded in x around 0 36.7%
mul-1-neg36.7%
associate-/r*36.9%
distribute-neg-frac236.9%
Simplified36.9%
Final simplification69.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
(let* ((t_1 (/ x_m (* z (+ y z)))))
(*
x_s
(if (<= z -6.2e+14)
t_1
(if (<= z 1.2e-36)
(/ x_m (* (- y z) t))
(if (<= z 2.35e+168) t_1 (* (/ 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 t_1 = x_m / (z * (y + z));
double tmp;
if (z <= -6.2e+14) {
tmp = t_1;
} else if (z <= 1.2e-36) {
tmp = x_m / ((y - z) * t);
} else if (z <= 2.35e+168) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x_m / (z * (y + z))
if (z <= (-6.2d+14)) then
tmp = t_1
else if (z <= 1.2d-36) then
tmp = x_m / ((y - z) * t)
else if (z <= 2.35d+168) then
tmp = t_1
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 t_1 = x_m / (z * (y + z));
double tmp;
if (z <= -6.2e+14) {
tmp = t_1;
} else if (z <= 1.2e-36) {
tmp = x_m / ((y - z) * t);
} else if (z <= 2.35e+168) {
tmp = t_1;
} 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): t_1 = x_m / (z * (y + z)) tmp = 0 if z <= -6.2e+14: tmp = t_1 elif z <= 1.2e-36: tmp = x_m / ((y - z) * t) elif z <= 2.35e+168: tmp = t_1 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) t_1 = Float64(x_m / Float64(z * Float64(y + z))) tmp = 0.0 if (z <= -6.2e+14) tmp = t_1; elseif (z <= 1.2e-36) tmp = Float64(x_m / Float64(Float64(y - z) * t)); elseif (z <= 2.35e+168) tmp = t_1; 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)
t_1 = x_m / (z * (y + z));
tmp = 0.0;
if (z <= -6.2e+14)
tmp = t_1;
elseif (z <= 1.2e-36)
tmp = x_m / ((y - z) * t);
elseif (z <= 2.35e+168)
tmp = t_1;
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_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -6.2e+14], t$95$1, If[LessEqual[z, 1.2e-36], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.35e+168], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(y + z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-36}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
\end{array}
if z < -6.2e14 or 1.2e-36 < z < 2.3499999999999998e168Initial program 89.8%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around 0 77.3%
associate-*r/77.3%
neg-mul-177.3%
Simplified77.3%
div-inv77.3%
associate-/l*73.4%
add-sqr-sqrt37.5%
sqrt-unprod52.2%
sqr-neg52.2%
sqrt-unprod21.4%
add-sqr-sqrt49.0%
sub-neg49.0%
add-sqr-sqrt38.4%
sqrt-unprod57.8%
sqr-neg57.8%
sqrt-unprod19.4%
add-sqr-sqrt67.8%
Applied egg-rr67.8%
associate-/r*67.8%
associate-*r/67.8%
*-rgt-identity67.8%
+-commutative67.8%
Simplified67.8%
if -6.2e14 < z < 1.2e-36Initial program 92.7%
Taylor expanded in t around inf 77.8%
if 2.3499999999999998e168 < z Initial program 68.7%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 90.0%
associate-*r/90.0%
neg-mul-190.0%
Simplified90.0%
div-inv90.1%
add-sqr-sqrt28.5%
sqrt-unprod61.7%
sqr-neg61.7%
sqrt-unprod48.4%
add-sqr-sqrt66.5%
sub-neg66.5%
add-sqr-sqrt0.0%
sqrt-unprod68.7%
sqr-neg68.7%
sqrt-unprod84.9%
add-sqr-sqrt85.0%
Applied egg-rr85.0%
Taylor expanded in y around 0 85.0%
Final simplification75.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -1.2e-211)
(/ x_m (* y (- t z)))
(if (<= t 8.8e-109)
(/ x_m (* z (- z y)))
(if (<= t 3.3e+123) (/ 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.2e-211) {
tmp = x_m / (y * (t - z));
} else if (t <= 8.8e-109) {
tmp = x_m / (z * (z - y));
} else if (t <= 3.3e+123) {
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.2d-211)) then
tmp = x_m / (y * (t - z))
else if (t <= 8.8d-109) then
tmp = x_m / (z * (z - y))
else if (t <= 3.3d+123) 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.2e-211) {
tmp = x_m / (y * (t - z));
} else if (t <= 8.8e-109) {
tmp = x_m / (z * (z - y));
} else if (t <= 3.3e+123) {
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.2e-211: tmp = x_m / (y * (t - z)) elif t <= 8.8e-109: tmp = x_m / (z * (z - y)) elif t <= 3.3e+123: 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.2e-211) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (t <= 8.8e-109) tmp = Float64(x_m / Float64(z * Float64(z - y))); elseif (t <= 3.3e+123) 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.2e-211)
tmp = x_m / (y * (t - z));
elseif (t <= 8.8e-109)
tmp = x_m / (z * (z - y));
elseif (t <= 3.3e+123)
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.2e-211], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e-109], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e+123], 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.2 \cdot 10^{-211}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-109}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+123}:\\
\;\;\;\;\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.2000000000000001e-211Initial program 88.0%
Taylor expanded in y around inf 59.9%
*-commutative59.9%
Simplified59.9%
if -1.2000000000000001e-211 < t < 8.7999999999999997e-109Initial program 90.4%
associate-/l/94.7%
Simplified94.7%
Taylor expanded in t around 0 79.8%
associate-*r/79.8%
neg-mul-179.8%
Simplified79.8%
frac-2neg79.8%
div-inv79.8%
distribute-frac-neg79.8%
remove-double-neg79.8%
sub-neg79.8%
distribute-neg-in79.8%
add-sqr-sqrt40.7%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod22.4%
add-sqr-sqrt50.7%
add-sqr-sqrt28.3%
sqrt-unprod61.3%
sqr-neg61.3%
sqrt-unprod39.1%
add-sqr-sqrt79.8%
Applied egg-rr79.8%
associate-*r/79.8%
*-rgt-identity79.8%
neg-mul-179.8%
+-commutative79.8%
neg-mul-179.8%
sub-neg79.8%
Simplified79.8%
Taylor expanded in x around 0 73.9%
if 8.7999999999999997e-109 < t < 3.30000000000000003e123Initial program 88.0%
Taylor expanded in t around inf 66.9%
if 3.30000000000000003e123 < t Initial program 86.4%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 95.5%
Final simplification70.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 -6e-291)
(/ (/ x_m y) (- t z))
(if (<= t 4.3e-110)
(/ x_m (* z (- z y)))
(if (<= t 5.1e+123) (/ 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 <= -6e-291) {
tmp = (x_m / y) / (t - z);
} else if (t <= 4.3e-110) {
tmp = x_m / (z * (z - y));
} else if (t <= 5.1e+123) {
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 <= (-6d-291)) then
tmp = (x_m / y) / (t - z)
else if (t <= 4.3d-110) then
tmp = x_m / (z * (z - y))
else if (t <= 5.1d+123) 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 <= -6e-291) {
tmp = (x_m / y) / (t - z);
} else if (t <= 4.3e-110) {
tmp = x_m / (z * (z - y));
} else if (t <= 5.1e+123) {
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 <= -6e-291: tmp = (x_m / y) / (t - z) elif t <= 4.3e-110: tmp = x_m / (z * (z - y)) elif t <= 5.1e+123: 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 <= -6e-291) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 4.3e-110) tmp = Float64(x_m / Float64(z * Float64(z - y))); elseif (t <= 5.1e+123) 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 <= -6e-291)
tmp = (x_m / y) / (t - z);
elseif (t <= 4.3e-110)
tmp = x_m / (z * (z - y));
elseif (t <= 5.1e+123)
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, -6e-291], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.3e-110], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.1e+123], 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 -6 \cdot 10^{-291}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{-110}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;t \leq 5.1 \cdot 10^{+123}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -6.0000000000000001e-291Initial program 86.7%
Taylor expanded in x around 0 86.7%
associate-/l/96.7%
Simplified96.7%
Taylor expanded in y around inf 64.3%
if -6.0000000000000001e-291 < t < 4.30000000000000025e-110Initial program 95.6%
associate-/l/97.3%
Simplified97.3%
Taylor expanded in t around 0 80.8%
associate-*r/80.8%
neg-mul-180.8%
Simplified80.8%
frac-2neg80.8%
div-inv80.7%
distribute-frac-neg80.7%
remove-double-neg80.7%
sub-neg80.7%
distribute-neg-in80.7%
add-sqr-sqrt45.5%
sqrt-unprod61.9%
sqr-neg61.9%
sqrt-unprod16.4%
add-sqr-sqrt47.5%
add-sqr-sqrt31.0%
sqrt-unprod62.2%
sqr-neg62.2%
sqrt-unprod35.2%
add-sqr-sqrt80.7%
Applied egg-rr80.7%
associate-*r/80.8%
*-rgt-identity80.8%
neg-mul-180.8%
+-commutative80.8%
neg-mul-180.8%
sub-neg80.8%
Simplified80.8%
Taylor expanded in x around 0 79.0%
if 4.30000000000000025e-110 < t < 5.09999999999999972e123Initial program 88.0%
Taylor expanded in t around inf 66.9%
if 5.09999999999999972e123 < t Initial program 86.4%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 95.5%
Final simplification72.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 -9.2e-186)
(/ (/ x_m y) (- t z))
(if (<= t 9.2e-109)
(/ (/ x_m z) (- z y))
(if (<= t 3.8e+123) (/ 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 <= -9.2e-186) {
tmp = (x_m / y) / (t - z);
} else if (t <= 9.2e-109) {
tmp = (x_m / z) / (z - y);
} else if (t <= 3.8e+123) {
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 <= (-9.2d-186)) then
tmp = (x_m / y) / (t - z)
else if (t <= 9.2d-109) then
tmp = (x_m / z) / (z - y)
else if (t <= 3.8d+123) 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 <= -9.2e-186) {
tmp = (x_m / y) / (t - z);
} else if (t <= 9.2e-109) {
tmp = (x_m / z) / (z - y);
} else if (t <= 3.8e+123) {
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 <= -9.2e-186: tmp = (x_m / y) / (t - z) elif t <= 9.2e-109: tmp = (x_m / z) / (z - y) elif t <= 3.8e+123: 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 <= -9.2e-186) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 9.2e-109) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (t <= 3.8e+123) 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 <= -9.2e-186)
tmp = (x_m / y) / (t - z);
elseif (t <= 9.2e-109)
tmp = (x_m / z) / (z - y);
elseif (t <= 3.8e+123)
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, -9.2e-186], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e-109], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+123], 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.2 \cdot 10^{-186}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-109}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+123}:\\
\;\;\;\;\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.2000000000000003e-186Initial program 87.5%
Taylor expanded in x around 0 87.5%
associate-/l/96.1%
Simplified96.1%
Taylor expanded in y around inf 62.3%
if -9.2000000000000003e-186 < t < 9.2000000000000006e-109Initial program 91.2%
associate-/l/95.1%
Simplified95.1%
Taylor expanded in t around 0 78.2%
associate-*r/78.2%
neg-mul-178.2%
Simplified78.2%
frac-2neg78.2%
div-inv78.2%
distribute-frac-neg78.2%
remove-double-neg78.2%
sub-neg78.2%
distribute-neg-in78.2%
add-sqr-sqrt42.2%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod20.6%
add-sqr-sqrt51.4%
add-sqr-sqrt30.9%
sqrt-unprod61.2%
sqr-neg61.2%
sqrt-unprod35.9%
add-sqr-sqrt78.2%
Applied egg-rr78.2%
associate-*r/78.2%
*-rgt-identity78.2%
neg-mul-178.2%
+-commutative78.2%
neg-mul-178.2%
sub-neg78.2%
Simplified78.2%
if 9.2000000000000006e-109 < t < 3.79999999999999994e123Initial program 88.0%
Taylor expanded in t around inf 66.9%
if 3.79999999999999994e123 < t Initial program 86.4%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 95.5%
Final simplification72.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -2.05e+21)
(/ (/ x_m y) (- t z))
(if (<= t 6e+152) (/ x_m (* (- y z) (- t z))) (/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -2.05e+21) {
tmp = (x_m / y) / (t - z);
} else if (t <= 6e+152) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.05d+21)) then
tmp = (x_m / y) / (t - z)
else if (t <= 6d+152) then
tmp = x_m / ((y - z) * (t - z))
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -2.05e+21) {
tmp = (x_m / y) / (t - z);
} else if (t <= 6e+152) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -2.05e+21: tmp = (x_m / y) / (t - z) elif t <= 6e+152: tmp = x_m / ((y - z) * (t - z)) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -2.05e+21) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 6e+152) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= -2.05e+21)
tmp = (x_m / y) / (t - z);
elseif (t <= 6e+152)
tmp = x_m / ((y - z) * (t - z));
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -2.05e+21], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+152], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{+21}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+152}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.05e21Initial program 85.0%
Taylor expanded in x around 0 85.0%
associate-/l/94.5%
Simplified94.5%
Taylor expanded in y around inf 62.0%
if -2.05e21 < t < 5.99999999999999981e152Initial program 91.0%
if 5.99999999999999981e152 < t Initial program 83.5%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 96.8%
Final simplification83.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -1500000000000.0) (not (<= z 8e-37)))
(* (/ x_m z) (/ -1.0 y))
(/ (/ x_m t) y))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1500000000000.0) || !(z <= 8e-37)) {
tmp = (x_m / z) * (-1.0 / y);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1500000000000.0d0)) .or. (.not. (z <= 8d-37))) then
tmp = (x_m / z) * ((-1.0d0) / y)
else
tmp = (x_m / t) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1500000000000.0) || !(z <= 8e-37)) {
tmp = (x_m / z) * (-1.0 / y);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -1500000000000.0) or not (z <= 8e-37): tmp = (x_m / z) * (-1.0 / y) else: tmp = (x_m / t) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -1500000000000.0) || !(z <= 8e-37)) tmp = Float64(Float64(x_m / z) * Float64(-1.0 / y)); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -1500000000000.0) || ~((z <= 8e-37)))
tmp = (x_m / z) * (-1.0 / y);
else
tmp = (x_m / t) / y;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1500000000000.0], N[Not[LessEqual[z, 8e-37]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * N[(-1.0 / y), $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 -1500000000000 \lor \neg \left(z \leq 8 \cdot 10^{-37}\right):\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{-1}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -1.5e12 or 8.00000000000000053e-37 < z Initial program 83.9%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around 0 80.8%
associate-*r/80.8%
neg-mul-180.8%
Simplified80.8%
div-inv80.9%
add-sqr-sqrt37.1%
sqrt-unprod55.0%
sqr-neg55.0%
sqrt-unprod27.5%
add-sqr-sqrt52.4%
sub-neg52.4%
add-sqr-sqrt26.9%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod37.6%
add-sqr-sqrt72.4%
Applied egg-rr72.4%
Taylor expanded in z around 0 33.7%
*-commutative33.7%
Simplified33.7%
add-sqr-sqrt14.6%
sqrt-unprod37.4%
sqr-neg37.4%
sqrt-unprod21.1%
add-sqr-sqrt37.5%
neg-mul-137.5%
*-commutative37.5%
times-frac46.1%
Applied egg-rr46.1%
if -1.5e12 < z < 8.00000000000000053e-37Initial program 92.7%
Taylor expanded in z around 0 62.3%
associate-/r*68.2%
div-inv68.2%
Applied egg-rr68.2%
un-div-inv68.2%
Applied egg-rr68.2%
Final simplification57.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -0.00075)
(* (/ x_m t) (/ 1.0 y))
(if (<= t 1.8e-112) (/ x_m (* 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 <= -0.00075) {
tmp = (x_m / t) * (1.0 / y);
} else if (t <= 1.8e-112) {
tmp = x_m / (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 <= (-0.00075d0)) then
tmp = (x_m / t) * (1.0d0 / y)
else if (t <= 1.8d-112) then
tmp = x_m / (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 <= -0.00075) {
tmp = (x_m / t) * (1.0 / y);
} else if (t <= 1.8e-112) {
tmp = x_m / (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 <= -0.00075: tmp = (x_m / t) * (1.0 / y) elif t <= 1.8e-112: tmp = x_m / (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 <= -0.00075) tmp = Float64(Float64(x_m / t) * Float64(1.0 / y)); elseif (t <= 1.8e-112) tmp = Float64(x_m / Float64(z * Float64(-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 <= -0.00075)
tmp = (x_m / t) * (1.0 / y);
elseif (t <= 1.8e-112)
tmp = x_m / (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, -0.00075], N[(N[(x$95$m / t), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e-112], N[(x$95$m / N[(z * (-y)), $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 -0.00075:\\
\;\;\;\;\frac{x\_m}{t} \cdot \frac{1}{y}\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -7.5000000000000002e-4Initial program 85.1%
Taylor expanded in z around 0 51.5%
associate-/r*62.1%
div-inv62.2%
Applied egg-rr62.2%
if -7.5000000000000002e-4 < t < 1.8e-112Initial program 92.2%
associate-/l/96.4%
Simplified96.4%
Taylor expanded in t around 0 76.3%
associate-*r/76.3%
neg-mul-176.3%
Simplified76.3%
Taylor expanded in z around 0 46.8%
associate-*r/46.8%
mul-1-neg46.8%
*-commutative46.8%
Simplified46.8%
if 1.8e-112 < t Initial program 87.3%
Taylor expanded in t around inf 75.1%
Final simplification61.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -2.7)
(* (/ x_m t) (/ 1.0 y))
(if (<= t 9.2e-109) (/ 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 <= -2.7) {
tmp = (x_m / t) * (1.0 / y);
} else if (t <= 9.2e-109) {
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 <= (-2.7d0)) then
tmp = (x_m / t) * (1.0d0 / y)
else if (t <= 9.2d-109) 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 <= -2.7) {
tmp = (x_m / t) * (1.0 / y);
} else if (t <= 9.2e-109) {
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 <= -2.7: tmp = (x_m / t) * (1.0 / y) elif t <= 9.2e-109: 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 <= -2.7) tmp = Float64(Float64(x_m / t) * Float64(1.0 / y)); elseif (t <= 9.2e-109) 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 <= -2.7)
tmp = (x_m / t) * (1.0 / y);
elseif (t <= 9.2e-109)
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, -2.7], N[(N[(x$95$m / t), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e-109], 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 -2.7:\\
\;\;\;\;\frac{x\_m}{t} \cdot \frac{1}{y}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-109}:\\
\;\;\;\;\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 < -2.7000000000000002Initial program 85.1%
Taylor expanded in z around 0 51.5%
associate-/r*62.1%
div-inv62.2%
Applied egg-rr62.2%
if -2.7000000000000002 < t < 9.2000000000000006e-109Initial program 92.2%
associate-/l/96.4%
Simplified96.4%
Taylor expanded in t around 0 76.3%
associate-*r/76.3%
neg-mul-176.3%
Simplified76.3%
frac-2neg76.3%
div-inv76.3%
distribute-frac-neg76.3%
remove-double-neg76.3%
sub-neg76.3%
distribute-neg-in76.3%
add-sqr-sqrt41.3%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod20.6%
add-sqr-sqrt51.7%
add-sqr-sqrt31.1%
sqrt-unprod61.1%
sqr-neg61.1%
sqrt-unprod35.0%
add-sqr-sqrt76.3%
Applied egg-rr76.3%
associate-*r/76.3%
*-rgt-identity76.3%
neg-mul-176.3%
+-commutative76.3%
neg-mul-176.3%
sub-neg76.3%
Simplified76.3%
Taylor expanded in x around 0 71.3%
if 9.2000000000000006e-109 < t Initial program 87.3%
Taylor expanded in t around inf 75.1%
Final simplification69.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 (<= t -1.15e-210)
(/ x_m (* y (- t z)))
(if (<= t 6e-109) (/ 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.15e-210) {
tmp = x_m / (y * (t - z));
} else if (t <= 6e-109) {
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.15d-210)) then
tmp = x_m / (y * (t - z))
else if (t <= 6d-109) 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.15e-210) {
tmp = x_m / (y * (t - z));
} else if (t <= 6e-109) {
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.15e-210: tmp = x_m / (y * (t - z)) elif t <= 6e-109: 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.15e-210) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (t <= 6e-109) 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.15e-210)
tmp = x_m / (y * (t - z));
elseif (t <= 6e-109)
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.15e-210], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-109], 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.15 \cdot 10^{-210}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-109}:\\
\;\;\;\;\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.15e-210Initial program 88.0%
Taylor expanded in y around inf 59.9%
*-commutative59.9%
Simplified59.9%
if -1.15e-210 < t < 6.00000000000000043e-109Initial program 90.4%
associate-/l/94.7%
Simplified94.7%
Taylor expanded in t around 0 79.8%
associate-*r/79.8%
neg-mul-179.8%
Simplified79.8%
frac-2neg79.8%
div-inv79.8%
distribute-frac-neg79.8%
remove-double-neg79.8%
sub-neg79.8%
distribute-neg-in79.8%
add-sqr-sqrt40.7%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod22.4%
add-sqr-sqrt50.7%
add-sqr-sqrt28.3%
sqrt-unprod61.3%
sqr-neg61.3%
sqrt-unprod39.1%
add-sqr-sqrt79.8%
Applied egg-rr79.8%
associate-*r/79.8%
*-rgt-identity79.8%
neg-mul-179.8%
+-commutative79.8%
neg-mul-179.8%
sub-neg79.8%
Simplified79.8%
Taylor expanded in x around 0 73.9%
if 6.00000000000000043e-109 < t Initial program 87.3%
Taylor expanded in t around inf 75.1%
Final simplification68.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -1.35e-44)
(/ (/ x_m y) (- t z))
(if (<= y 9.5e-179) (/ x_m (* z (- z t))) (/ (/ x_m (- y z)) t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -1.35e-44) {
tmp = (x_m / y) / (t - z);
} else if (y <= 9.5e-179) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / (y - z)) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.35d-44)) then
tmp = (x_m / y) / (t - z)
else if (y <= 9.5d-179) then
tmp = x_m / (z * (z - t))
else
tmp = (x_m / (y - z)) / t
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -1.35e-44) {
tmp = (x_m / y) / (t - z);
} else if (y <= 9.5e-179) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / (y - z)) / t;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -1.35e-44: tmp = (x_m / y) / (t - z) elif y <= 9.5e-179: tmp = x_m / (z * (z - t)) else: tmp = (x_m / (y - z)) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -1.35e-44) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 9.5e-179) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x_m / Float64(y - z)) / t); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -1.35e-44)
tmp = (x_m / y) / (t - z);
elseif (y <= 9.5e-179)
tmp = x_m / (z * (z - t));
else
tmp = (x_m / (y - z)) / t;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -1.35e-44], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e-179], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-179}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\end{array}
\end{array}
if y < -1.35e-44Initial program 86.9%
Taylor expanded in x around 0 86.9%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in y around inf 84.2%
if -1.35e-44 < y < 9.50000000000000037e-179Initial program 91.3%
Taylor expanded in y around 0 78.2%
associate-*r/78.2%
neg-mul-178.2%
Simplified78.2%
if 9.50000000000000037e-179 < y Initial program 87.2%
associate-/r*98.8%
div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in t around inf 75.0%
un-div-inv75.1%
Applied egg-rr75.1%
Final simplification79.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -3e+42) (not (<= z 8.2e-84)))
(/ (/ 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 <= -3e+42) || !(z <= 8.2e-84)) {
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 <= (-3d+42)) .or. (.not. (z <= 8.2d-84))) 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 <= -3e+42) || !(z <= 8.2e-84)) {
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 <= -3e+42) or not (z <= 8.2e-84): 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 <= -3e+42) || !(z <= 8.2e-84)) tmp = Float64(Float64(x_m / y) / Float64(-z)); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -3e+42) || ~((z <= 8.2e-84)))
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, -3e+42], N[Not[LessEqual[z, 8.2e-84]], $MachinePrecision]], N[(N[(x$95$m / y), $MachinePrecision] / (-z)), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+42} \lor \neg \left(z \leq 8.2 \cdot 10^{-84}\right):\\
\;\;\;\;\frac{\frac{x\_m}{y}}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -3.00000000000000029e42 or 8.2000000000000001e-84 < z Initial program 86.5%
associate-/l/97.1%
Simplified97.1%
Taylor expanded in t around 0 76.3%
associate-*r/76.3%
neg-mul-176.3%
Simplified76.3%
Taylor expanded in z around 0 37.0%
associate-*r/37.0%
mul-1-neg37.0%
*-commutative37.0%
Simplified37.0%
Taylor expanded in x around 0 37.0%
mul-1-neg37.0%
associate-/r*37.2%
distribute-neg-frac237.2%
Simplified37.2%
if -3.00000000000000029e42 < z < 8.2000000000000001e-84Initial program 90.4%
Taylor expanded in z around 0 62.9%
associate-/r*71.7%
div-inv71.7%
Applied egg-rr71.7%
un-div-inv71.7%
Applied egg-rr71.7%
Final simplification52.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 -550000000000.0) (not (<= z 1.2e-36)))
(/ 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 <= -550000000000.0) || !(z <= 1.2e-36)) {
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 <= (-550000000000.0d0)) .or. (.not. (z <= 1.2d-36))) 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 <= -550000000000.0) || !(z <= 1.2e-36)) {
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 <= -550000000000.0) or not (z <= 1.2e-36): 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 <= -550000000000.0) || !(z <= 1.2e-36)) 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 <= -550000000000.0) || ~((z <= 1.2e-36)))
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, -550000000000.0], N[Not[LessEqual[z, 1.2e-36]], $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 -550000000000 \lor \neg \left(z \leq 1.2 \cdot 10^{-36}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -5.5e11 or 1.2e-36 < z Initial program 83.9%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around 0 80.8%
associate-*r/80.8%
neg-mul-180.8%
Simplified80.8%
div-inv80.9%
add-sqr-sqrt37.1%
sqrt-unprod55.0%
sqr-neg55.0%
sqrt-unprod27.5%
add-sqr-sqrt52.4%
sub-neg52.4%
add-sqr-sqrt26.9%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod37.6%
add-sqr-sqrt72.4%
Applied egg-rr72.4%
Taylor expanded in z around 0 33.7%
*-commutative33.7%
Simplified33.7%
if -5.5e11 < z < 1.2e-36Initial program 92.7%
Taylor expanded in z around 0 62.3%
Final simplification47.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -1.08e+105) (not (<= z 1.2e-36)))
(/ x_m (* y z))
(/ (/ x_m t) y))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.08e+105) || !(z <= 1.2e-36)) {
tmp = x_m / (y * z);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.08d+105)) .or. (.not. (z <= 1.2d-36))) then
tmp = x_m / (y * z)
else
tmp = (x_m / t) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.08e+105) || !(z <= 1.2e-36)) {
tmp = x_m / (y * z);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -1.08e+105) or not (z <= 1.2e-36): tmp = x_m / (y * z) else: tmp = (x_m / t) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -1.08e+105) || !(z <= 1.2e-36)) tmp = Float64(x_m / Float64(y * z)); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -1.08e+105) || ~((z <= 1.2e-36)))
tmp = x_m / (y * z);
else
tmp = (x_m / t) / y;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.08e+105], N[Not[LessEqual[z, 1.2e-36]], $MachinePrecision]], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+105} \lor \neg \left(z \leq 1.2 \cdot 10^{-36}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if z < -1.07999999999999994e105 or 1.2e-36 < z Initial program 83.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 84.6%
associate-*r/84.6%
neg-mul-184.6%
Simplified84.6%
div-inv84.6%
add-sqr-sqrt36.8%
sqrt-unprod58.8%
sqr-neg58.8%
sqrt-unprod32.0%
add-sqr-sqrt59.5%
sub-neg59.5%
add-sqr-sqrt28.0%
sqrt-unprod68.9%
sqr-neg68.9%
sqrt-unprod46.1%
add-sqr-sqrt79.0%
Applied egg-rr79.0%
Taylor expanded in z around 0 37.7%
*-commutative37.7%
Simplified37.7%
if -1.07999999999999994e105 < z < 1.2e-36Initial program 91.3%
Taylor expanded in z around 0 54.5%
associate-/r*61.9%
div-inv61.9%
Applied egg-rr61.9%
un-div-inv61.9%
Applied egg-rr61.9%
Final simplification52.0%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ x_m (* y t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * (x_m / (y * t))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): return x_s * (x_m / (y * t))
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(x_m / Float64(y * t))) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp = code(x_s, x_m, y, z, t)
tmp = x_s * (x_m / (y * t));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \frac{x\_m}{y \cdot t}
\end{array}
Initial program 88.3%
Taylor expanded in z around 0 40.5%
Final simplification40.5%
(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 2024078
(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))))