
(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 17 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 -1e-311) 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 <= -1e-311) {
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 <= (-1d-311)) 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 <= -1e-311) {
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 <= -1e-311: 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 <= -1e-311) 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 <= -1e-311)
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, -1e-311], 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 -1 \cdot 10^{-311}:\\
\;\;\;\;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))) < -9.99999999999948e-312Initial program 98.3%
if -9.99999999999948e-312 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 90.4%
associate-/l/98.2%
Simplified98.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 (<= y -2.5e-33)
(/ x_m (* y (- t z)))
(if (<= y -3.9e-137)
(* (/ x_m z) (/ 1.0 z))
(if (or (<= y -6.8e-180) (not (<= y 3.2e-211)))
(/ (/ x_m t) (- y z))
(/ x_m (* z (- 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 <= -2.5e-33) {
tmp = x_m / (y * (t - z));
} else if (y <= -3.9e-137) {
tmp = (x_m / z) * (1.0 / z);
} else if ((y <= -6.8e-180) || !(y <= 3.2e-211)) {
tmp = (x_m / t) / (y - z);
} else {
tmp = x_m / (z * (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 <= (-2.5d-33)) then
tmp = x_m / (y * (t - z))
else if (y <= (-3.9d-137)) then
tmp = (x_m / z) * (1.0d0 / z)
else if ((y <= (-6.8d-180)) .or. (.not. (y <= 3.2d-211))) then
tmp = (x_m / t) / (y - z)
else
tmp = x_m / (z * (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 <= -2.5e-33) {
tmp = x_m / (y * (t - z));
} else if (y <= -3.9e-137) {
tmp = (x_m / z) * (1.0 / z);
} else if ((y <= -6.8e-180) || !(y <= 3.2e-211)) {
tmp = (x_m / t) / (y - z);
} else {
tmp = x_m / (z * (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 <= -2.5e-33: tmp = x_m / (y * (t - z)) elif y <= -3.9e-137: tmp = (x_m / z) * (1.0 / z) elif (y <= -6.8e-180) or not (y <= 3.2e-211): tmp = (x_m / t) / (y - z) else: tmp = x_m / (z * (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 <= -2.5e-33) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= -3.9e-137) tmp = Float64(Float64(x_m / z) * Float64(1.0 / z)); elseif ((y <= -6.8e-180) || !(y <= 3.2e-211)) tmp = Float64(Float64(x_m / t) / Float64(y - z)); else tmp = Float64(x_m / Float64(z * Float64(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 <= -2.5e-33)
tmp = x_m / (y * (t - z));
elseif (y <= -3.9e-137)
tmp = (x_m / z) * (1.0 / z);
elseif ((y <= -6.8e-180) || ~((y <= 3.2e-211)))
tmp = (x_m / t) / (y - z);
else
tmp = x_m / (z * (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, -2.5e-33], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.9e-137], N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -6.8e-180], N[Not[LessEqual[y, 3.2e-211]], $MachinePrecision]], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-33}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-137}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-180} \lor \neg \left(y \leq 3.2 \cdot 10^{-211}\right):\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\end{array}
\end{array}
if y < -2.50000000000000014e-33Initial program 96.8%
Taylor expanded in y around inf 85.2%
*-commutative85.2%
Simplified85.2%
if -2.50000000000000014e-33 < y < -3.8999999999999999e-137Initial program 88.0%
associate-/l/96.0%
div-inv95.8%
Applied egg-rr95.8%
Taylor expanded in y around 0 76.3%
Taylor expanded in t around 0 63.9%
associate-*r/67.6%
neg-mul-167.6%
Simplified63.9%
if -3.8999999999999999e-137 < y < -6.79999999999999963e-180 or 3.19999999999999985e-211 < y Initial program 90.0%
associate-/l/98.0%
Simplified98.0%
Taylor expanded in t around inf 64.2%
if -6.79999999999999963e-180 < y < 3.19999999999999985e-211Initial program 95.3%
Taylor expanded in y around 0 88.3%
associate-*r/88.3%
neg-mul-188.3%
Simplified88.3%
Final simplification73.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 -2.45e-33)
(/ x_m (* y (- t z)))
(if (or (<= y -1.05e-136) (and (not (<= y -6.5e-181)) (<= y 5.5e-253)))
(* (/ x_m z) (/ 1.0 z))
(/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.45e-33) {
tmp = x_m / (y * (t - z));
} else if ((y <= -1.05e-136) || (!(y <= -6.5e-181) && (y <= 5.5e-253))) {
tmp = (x_m / z) * (1.0 / z);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.45d-33)) then
tmp = x_m / (y * (t - z))
else if ((y <= (-1.05d-136)) .or. (.not. (y <= (-6.5d-181))) .and. (y <= 5.5d-253)) then
tmp = (x_m / z) * (1.0d0 / z)
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.45e-33) {
tmp = x_m / (y * (t - z));
} else if ((y <= -1.05e-136) || (!(y <= -6.5e-181) && (y <= 5.5e-253))) {
tmp = (x_m / z) * (1.0 / z);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -2.45e-33: tmp = x_m / (y * (t - z)) elif (y <= -1.05e-136) or (not (y <= -6.5e-181) and (y <= 5.5e-253)): tmp = (x_m / z) * (1.0 / z) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -2.45e-33) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif ((y <= -1.05e-136) || (!(y <= -6.5e-181) && (y <= 5.5e-253))) tmp = Float64(Float64(x_m / z) * Float64(1.0 / z)); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (y <= -2.45e-33)
tmp = x_m / (y * (t - z));
elseif ((y <= -1.05e-136) || (~((y <= -6.5e-181)) && (y <= 5.5e-253)))
tmp = (x_m / z) * (1.0 / z);
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -2.45e-33], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.05e-136], And[N[Not[LessEqual[y, -6.5e-181]], $MachinePrecision], LessEqual[y, 5.5e-253]]], N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.45 \cdot 10^{-33}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-136} \lor \neg \left(y \leq -6.5 \cdot 10^{-181}\right) \land y \leq 5.5 \cdot 10^{-253}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.4499999999999999e-33Initial program 96.8%
Taylor expanded in y around inf 85.2%
*-commutative85.2%
Simplified85.2%
if -2.4499999999999999e-33 < y < -1.0499999999999999e-136 or -6.4999999999999997e-181 < y < 5.49999999999999974e-253Initial program 91.0%
associate-/l/96.3%
div-inv96.1%
Applied egg-rr96.1%
Taylor expanded in y around 0 83.9%
Taylor expanded in t around 0 65.6%
associate-*r/69.1%
neg-mul-169.1%
Simplified65.6%
if -1.0499999999999999e-136 < y < -6.4999999999999997e-181 or 5.49999999999999974e-253 < y Initial program 90.8%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in t around inf 63.5%
Final simplification69.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* y (- z)))) (t_2 (- (/ (/ x_m z) z))))
(*
x_s
(if (<= z -2.2e+103)
t_2
(if (<= z -9.2e-86)
t_1
(if (<= z 2.1e-152)
(/ 1.0 (* y (/ t x_m)))
(if (<= z 2.8e+106) t_1 t_2)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (y * -z);
double t_2 = -((x_m / z) / z);
double tmp;
if (z <= -2.2e+103) {
tmp = t_2;
} else if (z <= -9.2e-86) {
tmp = t_1;
} else if (z <= 2.1e-152) {
tmp = 1.0 / (y * (t / x_m));
} else if (z <= 2.8e+106) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x_m / (y * -z)
t_2 = -((x_m / z) / z)
if (z <= (-2.2d+103)) then
tmp = t_2
else if (z <= (-9.2d-86)) then
tmp = t_1
else if (z <= 2.1d-152) then
tmp = 1.0d0 / (y * (t / x_m))
else if (z <= 2.8d+106) then
tmp = t_1
else
tmp = t_2
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (y * -z);
double t_2 = -((x_m / z) / z);
double tmp;
if (z <= -2.2e+103) {
tmp = t_2;
} else if (z <= -9.2e-86) {
tmp = t_1;
} else if (z <= 2.1e-152) {
tmp = 1.0 / (y * (t / x_m));
} else if (z <= 2.8e+106) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / (y * -z) t_2 = -((x_m / z) / z) tmp = 0 if z <= -2.2e+103: tmp = t_2 elif z <= -9.2e-86: tmp = t_1 elif z <= 2.1e-152: tmp = 1.0 / (y * (t / x_m)) elif z <= 2.8e+106: tmp = t_1 else: tmp = t_2 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(y * Float64(-z))) t_2 = Float64(-Float64(Float64(x_m / z) / z)) tmp = 0.0 if (z <= -2.2e+103) tmp = t_2; elseif (z <= -9.2e-86) tmp = t_1; elseif (z <= 2.1e-152) tmp = Float64(1.0 / Float64(y * Float64(t / x_m))); elseif (z <= 2.8e+106) tmp = t_1; else tmp = t_2; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / (y * -z);
t_2 = -((x_m / z) / z);
tmp = 0.0;
if (z <= -2.2e+103)
tmp = t_2;
elseif (z <= -9.2e-86)
tmp = t_1;
elseif (z <= 2.1e-152)
tmp = 1.0 / (y * (t / x_m));
elseif (z <= 2.8e+106)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision])}, N[(x$95$s * If[LessEqual[z, -2.2e+103], t$95$2, If[LessEqual[z, -9.2e-86], t$95$1, If[LessEqual[z, 2.1e-152], N[(1.0 / N[(y * N[(t / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+106], t$95$1, t$95$2]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{y \cdot \left(-z\right)}\\
t_2 := -\frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+103}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-152}:\\
\;\;\;\;\frac{1}{y \cdot \frac{t}{x\_m}}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -2.19999999999999992e103 or 2.79999999999999993e106 < z Initial program 85.9%
Taylor expanded in y around 0 85.0%
associate-*r/85.0%
neg-mul-185.0%
Simplified85.0%
div-inv85.0%
add-sqr-sqrt42.3%
sqrt-unprod80.0%
sqr-neg80.0%
sqrt-unprod41.5%
add-sqr-sqrt78.4%
Applied egg-rr78.4%
*-commutative78.4%
associate-*l/78.4%
times-frac78.2%
associate-*l/78.2%
*-lft-identity78.2%
Simplified78.2%
Taylor expanded in t around 0 78.2%
associate-*r/95.7%
neg-mul-195.7%
Simplified78.2%
if -2.19999999999999992e103 < z < -9.19999999999999985e-86 or 2.09999999999999999e-152 < z < 2.79999999999999993e106Initial program 98.6%
Taylor expanded in y around inf 51.6%
*-commutative51.6%
Simplified51.6%
Taylor expanded in t around 0 38.5%
associate-*r/38.5%
mul-1-neg38.5%
*-commutative38.5%
Simplified38.5%
if -9.19999999999999985e-86 < z < 2.09999999999999999e-152Initial program 93.2%
Taylor expanded in z around 0 74.7%
clear-num74.6%
inv-pow74.6%
associate-/l*73.8%
Applied egg-rr73.8%
unpow-173.8%
associate-*r/74.6%
Simplified74.6%
*-commutative74.6%
associate-/l*76.9%
Applied egg-rr76.9%
Final simplification64.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 (* y (- z)))) (t_2 (- (/ (/ x_m z) z))))
(*
x_s
(if (<= z -1.1e+103)
t_2
(if (<= z -1.05e-84)
t_1
(if (<= z 2.1e-152)
(* (/ x_m t) (/ 1.0 y))
(if (<= z 4e+104) t_1 t_2)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (y * -z);
double t_2 = -((x_m / z) / z);
double tmp;
if (z <= -1.1e+103) {
tmp = t_2;
} else if (z <= -1.05e-84) {
tmp = t_1;
} else if (z <= 2.1e-152) {
tmp = (x_m / t) * (1.0 / y);
} else if (z <= 4e+104) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x_m / (y * -z)
t_2 = -((x_m / z) / z)
if (z <= (-1.1d+103)) then
tmp = t_2
else if (z <= (-1.05d-84)) then
tmp = t_1
else if (z <= 2.1d-152) then
tmp = (x_m / t) * (1.0d0 / y)
else if (z <= 4d+104) then
tmp = t_1
else
tmp = t_2
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (y * -z);
double t_2 = -((x_m / z) / z);
double tmp;
if (z <= -1.1e+103) {
tmp = t_2;
} else if (z <= -1.05e-84) {
tmp = t_1;
} else if (z <= 2.1e-152) {
tmp = (x_m / t) * (1.0 / y);
} else if (z <= 4e+104) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / (y * -z) t_2 = -((x_m / z) / z) tmp = 0 if z <= -1.1e+103: tmp = t_2 elif z <= -1.05e-84: tmp = t_1 elif z <= 2.1e-152: tmp = (x_m / t) * (1.0 / y) elif z <= 4e+104: tmp = t_1 else: tmp = t_2 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(y * Float64(-z))) t_2 = Float64(-Float64(Float64(x_m / z) / z)) tmp = 0.0 if (z <= -1.1e+103) tmp = t_2; elseif (z <= -1.05e-84) tmp = t_1; elseif (z <= 2.1e-152) tmp = Float64(Float64(x_m / t) * Float64(1.0 / y)); elseif (z <= 4e+104) tmp = t_1; else tmp = t_2; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / (y * -z);
t_2 = -((x_m / z) / z);
tmp = 0.0;
if (z <= -1.1e+103)
tmp = t_2;
elseif (z <= -1.05e-84)
tmp = t_1;
elseif (z <= 2.1e-152)
tmp = (x_m / t) * (1.0 / y);
elseif (z <= 4e+104)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision])}, N[(x$95$s * If[LessEqual[z, -1.1e+103], t$95$2, If[LessEqual[z, -1.05e-84], t$95$1, If[LessEqual[z, 2.1e-152], N[(N[(x$95$m / t), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+104], t$95$1, t$95$2]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{y \cdot \left(-z\right)}\\
t_2 := -\frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+103}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-84}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-152}:\\
\;\;\;\;\frac{x\_m}{t} \cdot \frac{1}{y}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -1.09999999999999996e103 or 4e104 < z Initial program 85.9%
Taylor expanded in y around 0 85.0%
associate-*r/85.0%
neg-mul-185.0%
Simplified85.0%
div-inv85.0%
add-sqr-sqrt42.3%
sqrt-unprod80.0%
sqr-neg80.0%
sqrt-unprod41.5%
add-sqr-sqrt78.4%
Applied egg-rr78.4%
*-commutative78.4%
associate-*l/78.4%
times-frac78.2%
associate-*l/78.2%
*-lft-identity78.2%
Simplified78.2%
Taylor expanded in t around 0 78.2%
associate-*r/95.7%
neg-mul-195.7%
Simplified78.2%
if -1.09999999999999996e103 < z < -1.04999999999999999e-84 or 2.09999999999999999e-152 < z < 4e104Initial program 98.6%
Taylor expanded in y around inf 51.6%
*-commutative51.6%
Simplified51.6%
Taylor expanded in t around 0 38.5%
associate-*r/38.5%
mul-1-neg38.5%
*-commutative38.5%
Simplified38.5%
if -1.04999999999999999e-84 < z < 2.09999999999999999e-152Initial program 93.2%
Taylor expanded in z around 0 74.7%
associate-/r*77.0%
div-inv76.9%
Applied egg-rr76.9%
Final simplification64.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 (* y (- z)))) (t_2 (- (/ (/ x_m z) z))))
(*
x_s
(if (<= z -3.5e+102)
t_2
(if (<= z -7.8e-87)
t_1
(if (<= z 1.85e-152) (/ x_m (* y t)) (if (<= z 3.7e+105) t_1 t_2)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (y * -z);
double t_2 = -((x_m / z) / z);
double tmp;
if (z <= -3.5e+102) {
tmp = t_2;
} else if (z <= -7.8e-87) {
tmp = t_1;
} else if (z <= 1.85e-152) {
tmp = x_m / (y * t);
} else if (z <= 3.7e+105) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x_m / (y * -z)
t_2 = -((x_m / z) / z)
if (z <= (-3.5d+102)) then
tmp = t_2
else if (z <= (-7.8d-87)) then
tmp = t_1
else if (z <= 1.85d-152) then
tmp = x_m / (y * t)
else if (z <= 3.7d+105) then
tmp = t_1
else
tmp = t_2
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (y * -z);
double t_2 = -((x_m / z) / z);
double tmp;
if (z <= -3.5e+102) {
tmp = t_2;
} else if (z <= -7.8e-87) {
tmp = t_1;
} else if (z <= 1.85e-152) {
tmp = x_m / (y * t);
} else if (z <= 3.7e+105) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): t_1 = x_m / (y * -z) t_2 = -((x_m / z) / z) tmp = 0 if z <= -3.5e+102: tmp = t_2 elif z <= -7.8e-87: tmp = t_1 elif z <= 1.85e-152: tmp = x_m / (y * t) elif z <= 3.7e+105: tmp = t_1 else: tmp = t_2 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(y * Float64(-z))) t_2 = Float64(-Float64(Float64(x_m / z) / z)) tmp = 0.0 if (z <= -3.5e+102) tmp = t_2; elseif (z <= -7.8e-87) tmp = t_1; elseif (z <= 1.85e-152) tmp = Float64(x_m / Float64(y * t)); elseif (z <= 3.7e+105) tmp = t_1; else tmp = t_2; end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
t_1 = x_m / (y * -z);
t_2 = -((x_m / z) / z);
tmp = 0.0;
if (z <= -3.5e+102)
tmp = t_2;
elseif (z <= -7.8e-87)
tmp = t_1;
elseif (z <= 1.85e-152)
tmp = x_m / (y * t);
elseif (z <= 3.7e+105)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision])}, N[(x$95$s * If[LessEqual[z, -3.5e+102], t$95$2, If[LessEqual[z, -7.8e-87], t$95$1, If[LessEqual[z, 1.85e-152], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+105], t$95$1, t$95$2]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{y \cdot \left(-z\right)}\\
t_2 := -\frac{\frac{x\_m}{z}}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-152}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -3.50000000000000011e102 or 3.69999999999999985e105 < z Initial program 85.9%
Taylor expanded in y around 0 85.0%
associate-*r/85.0%
neg-mul-185.0%
Simplified85.0%
div-inv85.0%
add-sqr-sqrt42.3%
sqrt-unprod80.0%
sqr-neg80.0%
sqrt-unprod41.5%
add-sqr-sqrt78.4%
Applied egg-rr78.4%
*-commutative78.4%
associate-*l/78.4%
times-frac78.2%
associate-*l/78.2%
*-lft-identity78.2%
Simplified78.2%
Taylor expanded in t around 0 78.2%
associate-*r/95.7%
neg-mul-195.7%
Simplified78.2%
if -3.50000000000000011e102 < z < -7.7999999999999996e-87 or 1.8499999999999999e-152 < z < 3.69999999999999985e105Initial program 98.6%
Taylor expanded in y around inf 51.6%
*-commutative51.6%
Simplified51.6%
Taylor expanded in t around 0 38.5%
associate-*r/38.5%
mul-1-neg38.5%
*-commutative38.5%
Simplified38.5%
if -7.7999999999999996e-87 < z < 1.8499999999999999e-152Initial program 93.2%
Taylor expanded in z around 0 74.7%
Final simplification64.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 (* t (- z)))))
(*
x_s
(if (<= z -1.02e-112)
t_1
(if (<= z 2.5e-90)
(/ x_m (* y t))
(if (<= z 2.3e+116) 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 * -z);
double tmp;
if (z <= -1.02e-112) {
tmp = t_1;
} else if (z <= 2.5e-90) {
tmp = x_m / (y * t);
} else if (z <= 2.3e+116) {
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 * -z)
if (z <= (-1.02d-112)) then
tmp = t_1
else if (z <= 2.5d-90) then
tmp = x_m / (y * t)
else if (z <= 2.3d+116) 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 * -z);
double tmp;
if (z <= -1.02e-112) {
tmp = t_1;
} else if (z <= 2.5e-90) {
tmp = x_m / (y * t);
} else if (z <= 2.3e+116) {
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 * -z) tmp = 0 if z <= -1.02e-112: tmp = t_1 elif z <= 2.5e-90: tmp = x_m / (y * t) elif z <= 2.3e+116: 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(x_m / Float64(t * Float64(-z))) tmp = 0.0 if (z <= -1.02e-112) tmp = t_1; elseif (z <= 2.5e-90) tmp = Float64(x_m / Float64(y * t)); elseif (z <= 2.3e+116) tmp = t_1; else tmp = Float64(Float64(x_m / 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)
t_1 = x_m / (t * -z);
tmp = 0.0;
if (z <= -1.02e-112)
tmp = t_1;
elseif (z <= 2.5e-90)
tmp = x_m / (y * t);
elseif (z <= 2.3e+116)
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[(x$95$m / N[(t * (-z)), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.02e-112], t$95$1, If[LessEqual[z, 2.5e-90], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+116], t$95$1, N[(N[(x$95$m / z), $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])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{t \cdot \left(-z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-90}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{t}\\
\end{array}
\end{array}
\end{array}
if z < -1.01999999999999996e-112 or 2.5000000000000001e-90 < z < 2.29999999999999995e116Initial program 93.6%
Taylor expanded in y around 0 69.1%
associate-*r/69.1%
neg-mul-169.1%
Simplified69.1%
Taylor expanded in z around 0 35.9%
associate-*r/35.9%
mul-1-neg35.9%
Simplified35.9%
if -1.01999999999999996e-112 < z < 2.5000000000000001e-90Initial program 93.7%
Taylor expanded in z around 0 71.5%
if 2.29999999999999995e116 < z Initial program 86.2%
Taylor expanded in y around 0 86.2%
associate-*r/86.2%
neg-mul-186.2%
Simplified86.2%
Taylor expanded in z around 0 45.4%
associate-*r/45.4%
mul-1-neg45.4%
Simplified45.4%
div-inv45.4%
add-sqr-sqrt23.0%
sqrt-unprod52.0%
sqr-neg52.0%
sqrt-unprod22.5%
add-sqr-sqrt45.3%
associate-/r*45.3%
Applied egg-rr45.3%
*-commutative45.3%
associate-*l/45.2%
associate-*r/52.0%
associate-*l/52.0%
*-lft-identity52.0%
Simplified52.0%
Final simplification51.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 (or (<= z -1.32e+131) (not (<= z 8.5e+136)))
(/ (/ x_m z) (- z t))
(/ x_m (* (- y z) (- t z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.32e+131) || !(z <= 8.5e+136)) {
tmp = (x_m / z) / (z - t);
} else {
tmp = x_m / ((y - z) * (t - z));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.32d+131)) .or. (.not. (z <= 8.5d+136))) then
tmp = (x_m / z) / (z - t)
else
tmp = x_m / ((y - z) * (t - z))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.32e+131) || !(z <= 8.5e+136)) {
tmp = (x_m / z) / (z - t);
} else {
tmp = x_m / ((y - z) * (t - z));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -1.32e+131) or not (z <= 8.5e+136): tmp = (x_m / z) / (z - t) else: tmp = x_m / ((y - z) * (t - z)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -1.32e+131) || !(z <= 8.5e+136)) tmp = Float64(Float64(x_m / z) / Float64(z - t)); else tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -1.32e+131) || ~((z <= 8.5e+136)))
tmp = (x_m / z) / (z - t);
else
tmp = x_m / ((y - z) * (t - z));
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.32e+131], N[Not[LessEqual[z, 8.5e+136]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+131} \lor \neg \left(z \leq 8.5 \cdot 10^{+136}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -1.32e131 or 8.49999999999999966e136 < z Initial program 85.7%
Taylor expanded in x around 0 85.7%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
associate-*r/99.9%
mul-1-neg99.9%
Simplified99.9%
if -1.32e131 < z < 8.49999999999999966e136Initial program 95.5%
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
(*
x_s
(if (or (<= t -5.5e-50) (not (<= t 1.26e-90)))
(/ x_m (* (- y z) t))
(/ x_m (* y (- z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((t <= -5.5e-50) || !(t <= 1.26e-90)) {
tmp = x_m / ((y - z) * t);
} else {
tmp = x_m / (y * -z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-5.5d-50)) .or. (.not. (t <= 1.26d-90))) then
tmp = x_m / ((y - z) * t)
else
tmp = x_m / (y * -z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((t <= -5.5e-50) || !(t <= 1.26e-90)) {
tmp = x_m / ((y - z) * t);
} else {
tmp = x_m / (y * -z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (t <= -5.5e-50) or not (t <= 1.26e-90): tmp = x_m / ((y - z) * t) else: tmp = x_m / (y * -z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((t <= -5.5e-50) || !(t <= 1.26e-90)) tmp = Float64(x_m / Float64(Float64(y - z) * t)); else tmp = Float64(x_m / Float64(y * Float64(-z))); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((t <= -5.5e-50) || ~((t <= 1.26e-90)))
tmp = x_m / ((y - z) * t);
else
tmp = x_m / (y * -z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[t, -5.5e-50], N[Not[LessEqual[t, 1.26e-90]], $MachinePrecision]], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-50} \lor \neg \left(t \leq 1.26 \cdot 10^{-90}\right):\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(-z\right)}\\
\end{array}
\end{array}
if t < -5.49999999999999975e-50 or 1.26e-90 < t Initial program 92.9%
Taylor expanded in t around inf 84.4%
if -5.49999999999999975e-50 < t < 1.26e-90Initial program 91.8%
Taylor expanded in y around inf 58.1%
*-commutative58.1%
Simplified58.1%
Taylor expanded in t around 0 50.6%
associate-*r/50.6%
mul-1-neg50.6%
*-commutative50.6%
Simplified50.6%
Final simplification70.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.5e-18)
(/ (/ x_m y) (- t z))
(if (<= t 6e-77) (/ (/ x_m z) (- z y)) (/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -2.5e-18) {
tmp = (x_m / y) / (t - z);
} else if (t <= 6e-77) {
tmp = (x_m / z) / (z - y);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.5d-18)) then
tmp = (x_m / y) / (t - z)
else if (t <= 6d-77) then
tmp = (x_m / z) / (z - y)
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -2.5e-18) {
tmp = (x_m / y) / (t - z);
} else if (t <= 6e-77) {
tmp = (x_m / z) / (z - y);
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -2.5e-18: tmp = (x_m / y) / (t - z) elif t <= 6e-77: tmp = (x_m / z) / (z - y) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -2.5e-18) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 6e-77) tmp = Float64(Float64(x_m / z) / Float64(z - y)); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= -2.5e-18)
tmp = (x_m / y) / (t - z);
elseif (t <= 6e-77)
tmp = (x_m / z) / (z - y);
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -2.5e-18], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-77], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $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.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.50000000000000018e-18Initial program 92.9%
Taylor expanded in x around 0 92.9%
associate-/l/97.2%
Simplified97.2%
Taylor expanded in y around inf 60.3%
if -2.50000000000000018e-18 < t < 6.00000000000000033e-77Initial program 91.8%
associate-/l/96.6%
Simplified96.6%
Taylor expanded in t around 0 84.9%
associate-*r/84.9%
neg-mul-184.9%
Simplified84.9%
if 6.00000000000000033e-77 < t Initial program 93.0%
associate-/l/96.6%
Simplified96.6%
Taylor expanded in t around inf 87.9%
Final simplification79.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 (<= y -126000000.0)
(/ x_m (* y (- t z)))
(if (<= y 5.3e-114) (/ (/ 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 <= -126000000.0) {
tmp = x_m / (y * (t - z));
} else if (y <= 5.3e-114) {
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 <= (-126000000.0d0)) then
tmp = x_m / (y * (t - z))
else if (y <= 5.3d-114) 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 <= -126000000.0) {
tmp = x_m / (y * (t - z));
} else if (y <= 5.3e-114) {
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 <= -126000000.0: tmp = x_m / (y * (t - z)) elif y <= 5.3e-114: 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 <= -126000000.0) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 5.3e-114) 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 <= -126000000.0)
tmp = x_m / (y * (t - z));
elseif (y <= 5.3e-114)
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, -126000000.0], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.3e-114], 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 -126000000:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-114}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.26e8Initial program 96.3%
Taylor expanded in y around inf 89.3%
*-commutative89.3%
Simplified89.3%
if -1.26e8 < y < 5.29999999999999973e-114Initial program 91.2%
Taylor expanded in x around 0 91.2%
associate-/l/96.3%
Simplified96.3%
Taylor expanded in y around 0 78.8%
associate-*r/78.8%
mul-1-neg78.8%
Simplified78.8%
if 5.29999999999999973e-114 < y Initial program 91.5%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in t around inf 62.4%
Final simplification75.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 -2.2e-86) (not (<= z 2.1e-152)))
(/ 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 <= -2.2e-86) || !(z <= 2.1e-152)) {
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 <= (-2.2d-86)) .or. (.not. (z <= 2.1d-152))) 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 <= -2.2e-86) || !(z <= 2.1e-152)) {
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 <= -2.2e-86) or not (z <= 2.1e-152): 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 <= -2.2e-86) || !(z <= 2.1e-152)) tmp = Float64(x_m / Float64(y * Float64(-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 <= -2.2e-86) || ~((z <= 2.1e-152)))
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, -2.2e-86], N[Not[LessEqual[z, 2.1e-152]], $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 -2.2 \cdot 10^{-86} \lor \neg \left(z \leq 2.1 \cdot 10^{-152}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot \left(-z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.2000000000000002e-86 or 2.09999999999999999e-152 < z Initial program 92.1%
Taylor expanded in y around inf 49.5%
*-commutative49.5%
Simplified49.5%
Taylor expanded in t around 0 42.6%
associate-*r/42.6%
mul-1-neg42.6%
*-commutative42.6%
Simplified42.6%
if -2.2000000000000002e-86 < z < 2.09999999999999999e-152Initial program 93.2%
Taylor expanded in z around 0 74.7%
Final simplification53.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 (or (<= z -2.4e+102) (not (<= z 3.5e+75)))
(/ (/ x_m z) t)
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -2.4e+102) || !(z <= 3.5e+75)) {
tmp = (x_m / z) / t;
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.4d+102)) .or. (.not. (z <= 3.5d+75))) then
tmp = (x_m / z) / t
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -2.4e+102) || !(z <= 3.5e+75)) {
tmp = (x_m / z) / t;
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -2.4e+102) or not (z <= 3.5e+75): tmp = (x_m / z) / t else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -2.4e+102) || !(z <= 3.5e+75)) tmp = Float64(Float64(x_m / z) / t); 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 <= -2.4e+102) || ~((z <= 3.5e+75)))
tmp = (x_m / z) / t;
else
tmp = x_m / (y * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -2.4e+102], N[Not[LessEqual[z, 3.5e+75]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / t), $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 -2.4 \cdot 10^{+102} \lor \neg \left(z \leq 3.5 \cdot 10^{+75}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.39999999999999994e102 or 3.4999999999999998e75 < z Initial program 86.8%
Taylor expanded in y around 0 83.0%
associate-*r/83.0%
neg-mul-183.0%
Simplified83.0%
Taylor expanded in z around 0 40.5%
associate-*r/40.5%
mul-1-neg40.5%
Simplified40.5%
div-inv40.5%
add-sqr-sqrt17.9%
sqrt-unprod53.3%
sqr-neg53.3%
sqrt-unprod22.6%
add-sqr-sqrt40.6%
associate-/r*40.6%
Applied egg-rr40.6%
*-commutative40.6%
associate-*l/39.5%
associate-*r/51.4%
associate-*l/51.4%
*-lft-identity51.4%
Simplified51.4%
if -2.39999999999999994e102 < z < 3.4999999999999998e75Initial program 95.7%
Taylor expanded in z around 0 50.6%
Final simplification50.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 -1e+70) (not (<= z 3.3e+158)))
(/ x_m (* z t))
(/ x_m (* y t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1e+70) || !(z <= 3.3e+158)) {
tmp = x_m / (z * t);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1d+70)) .or. (.not. (z <= 3.3d+158))) then
tmp = x_m / (z * t)
else
tmp = x_m / (y * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1e+70) || !(z <= 3.3e+158)) {
tmp = x_m / (z * t);
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -1e+70) or not (z <= 3.3e+158): tmp = x_m / (z * t) else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -1e+70) || !(z <= 3.3e+158)) tmp = Float64(x_m / Float64(z * t)); 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 <= -1e+70) || ~((z <= 3.3e+158)))
tmp = x_m / (z * t);
else
tmp = x_m / (y * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1e+70], N[Not[LessEqual[z, 3.3e+158]], $MachinePrecision]], N[(x$95$m / N[(z * t), $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 \cdot 10^{+70} \lor \neg \left(z \leq 3.3 \cdot 10^{+158}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.00000000000000007e70 or 3.30000000000000017e158 < z Initial program 86.6%
Taylor expanded in y around 0 84.5%
associate-*r/84.5%
neg-mul-184.5%
Simplified84.5%
div-inv84.5%
add-sqr-sqrt42.7%
sqrt-unprod79.3%
sqr-neg79.3%
sqrt-unprod40.6%
add-sqr-sqrt78.8%
Applied egg-rr78.8%
*-commutative78.8%
associate-*l/78.8%
times-frac77.5%
associate-*l/77.5%
*-lft-identity77.5%
Simplified77.5%
Taylor expanded in t around inf 42.5%
*-commutative42.5%
Simplified42.5%
if -1.00000000000000007e70 < z < 3.30000000000000017e158Initial program 95.3%
Taylor expanded in z around 0 48.6%
Final simplification46.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.1e-23) (/ x_m (* y (- t z))) (/ (/ x_m t) (- y z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 2.1e-23) {
tmp = x_m / (y * (t - z));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 2.1d-23) then
tmp = x_m / (y * (t - z))
else
tmp = (x_m / t) / (y - z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 2.1e-23) {
tmp = x_m / (y * (t - z));
} else {
tmp = (x_m / t) / (y - z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= 2.1e-23: tmp = x_m / (y * (t - z)) else: tmp = (x_m / t) / (y - z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= 2.1e-23) tmp = Float64(x_m / Float64(y * Float64(t - z))); else tmp = Float64(Float64(x_m / t) / Float64(y - z)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= 2.1e-23)
tmp = x_m / (y * (t - z));
else
tmp = (x_m / t) / (y - z);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 2.1e-23], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq 2.1 \cdot 10^{-23}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.1000000000000001e-23Initial program 92.0%
Taylor expanded in y around inf 56.8%
*-commutative56.8%
Simplified56.8%
if 2.1000000000000001e-23 < t Initial program 93.6%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in t around inf 91.0%
Final simplification65.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.1e-84) (/ x_m (* y (- t z))) (/ x_m (* (- y z) t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 1.1e-84) {
tmp = x_m / (y * (t - z));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.1d-84) then
tmp = x_m / (y * (t - z))
else
tmp = x_m / ((y - z) * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 1.1e-84) {
tmp = x_m / (y * (t - z));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= 1.1e-84: tmp = x_m / (y * (t - z)) else: tmp = x_m / ((y - z) * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= 1.1e-84) tmp = Float64(x_m / Float64(y * Float64(t - z))); else tmp = Float64(x_m / Float64(Float64(y - z) * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= 1.1e-84)
tmp = x_m / (y * (t - z));
else
tmp = x_m / ((y - z) * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 1.1e-84], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq 1.1 \cdot 10^{-84}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 1.0999999999999999e-84Initial program 92.2%
Taylor expanded in y around inf 56.5%
*-commutative56.5%
Simplified56.5%
if 1.0999999999999999e-84 < t Initial program 93.0%
Taylor expanded in t around inf 88.3%
Final simplification65.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 92.4%
Taylor expanded in z around 0 40.6%
Final simplification40.6%
(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 2024103
(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))))