
(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 16 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) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* (/ (sqrt x_m) (- y z)) (/ (sqrt x_m) (- t z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((sqrt(x_m) / (y - z)) * (sqrt(x_m) / (t - z)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 * ((sqrt(x_m) / (y - z)) * (sqrt(x_m) / (t - z)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((Math.sqrt(x_m) / (y - z)) * (Math.sqrt(x_m) / (t - z)));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * ((math.sqrt(x_m) / (y - z)) * (math.sqrt(x_m) / (t - z)))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(Float64(sqrt(x_m) / Float64(y - z)) * Float64(sqrt(x_m) / Float64(t - z)))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * ((sqrt(x_m) / (y - z)) * (sqrt(x_m) / (t - z))); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(N[(N[Sqrt[x$95$m], $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[x$95$m], $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\_s \cdot \left(\frac{\sqrt{x\_m}}{y - z} \cdot \frac{\sqrt{x\_m}}{t - z}\right)
\end{array}
Initial program 86.9%
add-sqr-sqrt40.8%
times-frac46.6%
Applied egg-rr46.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* z (- z y)))))
(*
x_s
(if (<= t -1.05e-77)
(/ (/ x_m y) (- t z))
(if (<= t 8.5e-120)
t_1
(if (<= t 2.22e-100)
(/ (/ x_m t) (- y z))
(if (<= t 8e-91)
t_1
(if (<= t 7e+14)
(/ x_m (* z (- z t)))
(/ (/ x_m (- y z)) t)))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * (z - y));
double tmp;
if (t <= -1.05e-77) {
tmp = (x_m / y) / (t - z);
} else if (t <= 8.5e-120) {
tmp = t_1;
} else if (t <= 2.22e-100) {
tmp = (x_m / t) / (y - z);
} else if (t <= 8e-91) {
tmp = t_1;
} else if (t <= 7e+14) {
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)
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 - y))
if (t <= (-1.05d-77)) then
tmp = (x_m / y) / (t - z)
else if (t <= 8.5d-120) then
tmp = t_1
else if (t <= 2.22d-100) then
tmp = (x_m / t) / (y - z)
else if (t <= 8d-91) then
tmp = t_1
else if (t <= 7d+14) 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);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m / (z * (z - y));
double tmp;
if (t <= -1.05e-77) {
tmp = (x_m / y) / (t - z);
} else if (t <= 8.5e-120) {
tmp = t_1;
} else if (t <= 2.22e-100) {
tmp = (x_m / t) / (y - z);
} else if (t <= 8e-91) {
tmp = t_1;
} else if (t <= 7e+14) {
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) def code(x_s, x_m, y, z, t): t_1 = x_m / (z * (z - y)) tmp = 0 if t <= -1.05e-77: tmp = (x_m / y) / (t - z) elif t <= 8.5e-120: tmp = t_1 elif t <= 2.22e-100: tmp = (x_m / t) / (y - z) elif t <= 8e-91: tmp = t_1 elif t <= 7e+14: 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) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(z * Float64(z - y))) tmp = 0.0 if (t <= -1.05e-77) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 8.5e-120) tmp = t_1; elseif (t <= 2.22e-100) tmp = Float64(Float64(x_m / t) / Float64(y - z)); elseif (t <= 8e-91) tmp = t_1; elseif (t <= 7e+14) 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); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = x_m / (z * (z - y)); tmp = 0.0; if (t <= -1.05e-77) tmp = (x_m / y) / (t - z); elseif (t <= 8.5e-120) tmp = t_1; elseif (t <= 2.22e-100) tmp = (x_m / t) / (y - z); elseif (t <= 8e-91) tmp = t_1; elseif (t <= 7e+14) 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -1.05e-77], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-120], t$95$1, If[LessEqual[t, 2.22e-100], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e-91], t$95$1, If[LessEqual[t, 7e+14], 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)
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(z - y\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.22 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+14}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\end{array}
\end{array}
\end{array}
if t < -1.05000000000000008e-77Initial program 89.3%
associate-/r*98.5%
Applied egg-rr98.5%
Taylor expanded in y around inf 62.3%
if -1.05000000000000008e-77 < t < 8.50000000000000059e-120 or 2.2199999999999999e-100 < t < 8.00000000000000018e-91Initial program 90.6%
associate-/r*97.6%
clear-num96.4%
Applied egg-rr96.4%
Taylor expanded in t around 0 77.4%
mul-1-neg77.4%
associate-*l/83.6%
distribute-rgt-neg-in83.6%
Simplified83.6%
Taylor expanded in x around 0 78.3%
if 8.50000000000000059e-120 < t < 2.2199999999999999e-100Initial program 89.2%
Taylor expanded in t around inf 78.5%
*-commutative78.5%
associate-/r*89.0%
Simplified89.0%
associate-/l/78.5%
associate-/r*79.1%
Applied egg-rr79.1%
if 8.00000000000000018e-91 < t < 7e14Initial program 94.7%
Taylor expanded in y around 0 48.6%
mul-1-neg48.6%
distribute-neg-frac248.6%
distribute-rgt-neg-in48.6%
neg-sub048.6%
associate--r-48.6%
neg-sub048.6%
mul-1-neg48.6%
+-commutative48.6%
mul-1-neg48.6%
unsub-neg48.6%
Simplified48.6%
if 7e14 < t Initial program 74.7%
Taylor expanded in t around inf 71.6%
*-commutative71.6%
associate-/r*81.7%
Simplified81.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -2.25e-7)
(/ (/ x_m y) (- t z))
(if (<= y -9.5e-215)
(/ x_m (* z (- z y)))
(if (or (<= y -3.2e-299) (not (<= y 6e-156)))
(/ (/ x_m t) (- y z))
(/ x_m (* z (- z t))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.25e-7) {
tmp = (x_m / y) / (t - z);
} else if (y <= -9.5e-215) {
tmp = x_m / (z * (z - y));
} else if ((y <= -3.2e-299) || !(y <= 6e-156)) {
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)
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.25d-7)) then
tmp = (x_m / y) / (t - z)
else if (y <= (-9.5d-215)) then
tmp = x_m / (z * (z - y))
else if ((y <= (-3.2d-299)) .or. (.not. (y <= 6d-156))) 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);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.25e-7) {
tmp = (x_m / y) / (t - z);
} else if (y <= -9.5e-215) {
tmp = x_m / (z * (z - y));
} else if ((y <= -3.2e-299) || !(y <= 6e-156)) {
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) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -2.25e-7: tmp = (x_m / y) / (t - z) elif y <= -9.5e-215: tmp = x_m / (z * (z - y)) elif (y <= -3.2e-299) or not (y <= 6e-156): 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) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -2.25e-7) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= -9.5e-215) tmp = Float64(x_m / Float64(z * Float64(z - y))); elseif ((y <= -3.2e-299) || !(y <= 6e-156)) 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); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -2.25e-7) tmp = (x_m / y) / (t - z); elseif (y <= -9.5e-215) tmp = x_m / (z * (z - y)); elseif ((y <= -3.2e-299) || ~((y <= 6e-156))) 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -2.25e-7], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9.5e-215], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -3.2e-299], N[Not[LessEqual[y, 6e-156]], $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\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{-215}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-299} \lor \neg \left(y \leq 6 \cdot 10^{-156}\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.2499999999999999e-7Initial program 81.3%
associate-/r*98.2%
Applied egg-rr98.2%
Taylor expanded in y around inf 84.7%
if -2.2499999999999999e-7 < y < -9.5000000000000007e-215Initial program 94.7%
associate-/r*97.7%
clear-num97.7%
Applied egg-rr97.7%
Taylor expanded in t around 0 57.9%
mul-1-neg57.9%
associate-*l/61.9%
distribute-rgt-neg-in61.9%
Simplified61.9%
Taylor expanded in x around 0 57.9%
if -9.5000000000000007e-215 < y < -3.20000000000000008e-299 or 6e-156 < y Initial program 84.7%
Taylor expanded in t around inf 54.9%
*-commutative54.9%
associate-/r*63.6%
Simplified63.6%
associate-/l/54.9%
associate-/r*59.8%
Applied egg-rr59.8%
if -3.20000000000000008e-299 < y < 6e-156Initial program 92.5%
Taylor expanded in y around 0 86.5%
mul-1-neg86.5%
distribute-neg-frac286.5%
distribute-rgt-neg-in86.5%
neg-sub086.5%
associate--r-86.5%
neg-sub086.5%
mul-1-neg86.5%
+-commutative86.5%
mul-1-neg86.5%
unsub-neg86.5%
Simplified86.5%
Final simplification68.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -2.25e-7)
(/ x_m (* y (- t z)))
(if (<= y -4.6e-215)
(/ x_m (* z (- z y)))
(if (or (<= y -1.2e-301) (not (<= y 4.2e-155)))
(/ (/ x_m t) (- y z))
(/ x_m (* z (- z t))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.25e-7) {
tmp = x_m / (y * (t - z));
} else if (y <= -4.6e-215) {
tmp = x_m / (z * (z - y));
} else if ((y <= -1.2e-301) || !(y <= 4.2e-155)) {
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)
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.25d-7)) then
tmp = x_m / (y * (t - z))
else if (y <= (-4.6d-215)) then
tmp = x_m / (z * (z - y))
else if ((y <= (-1.2d-301)) .or. (.not. (y <= 4.2d-155))) 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);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.25e-7) {
tmp = x_m / (y * (t - z));
} else if (y <= -4.6e-215) {
tmp = x_m / (z * (z - y));
} else if ((y <= -1.2e-301) || !(y <= 4.2e-155)) {
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) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -2.25e-7: tmp = x_m / (y * (t - z)) elif y <= -4.6e-215: tmp = x_m / (z * (z - y)) elif (y <= -1.2e-301) or not (y <= 4.2e-155): 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) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -2.25e-7) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= -4.6e-215) tmp = Float64(x_m / Float64(z * Float64(z - y))); elseif ((y <= -1.2e-301) || !(y <= 4.2e-155)) 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); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -2.25e-7) tmp = x_m / (y * (t - z)); elseif (y <= -4.6e-215) tmp = x_m / (z * (z - y)); elseif ((y <= -1.2e-301) || ~((y <= 4.2e-155))) 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -2.25e-7], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.6e-215], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.2e-301], N[Not[LessEqual[y, 4.2e-155]], $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\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{-7}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{-215}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-301} \lor \neg \left(y \leq 4.2 \cdot 10^{-155}\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.2499999999999999e-7Initial program 81.3%
Taylor expanded in y around inf 77.9%
*-commutative77.9%
Simplified77.9%
if -2.2499999999999999e-7 < y < -4.5999999999999998e-215Initial program 94.7%
associate-/r*97.7%
clear-num97.7%
Applied egg-rr97.7%
Taylor expanded in t around 0 57.9%
mul-1-neg57.9%
associate-*l/61.9%
distribute-rgt-neg-in61.9%
Simplified61.9%
Taylor expanded in x around 0 57.9%
if -4.5999999999999998e-215 < y < -1.19999999999999996e-301 or 4.2000000000000003e-155 < y Initial program 84.7%
Taylor expanded in t around inf 54.9%
*-commutative54.9%
associate-/r*63.6%
Simplified63.6%
associate-/l/54.9%
associate-/r*59.8%
Applied egg-rr59.8%
if -1.19999999999999996e-301 < y < 4.2000000000000003e-155Initial program 92.5%
Taylor expanded in y around 0 86.5%
mul-1-neg86.5%
distribute-neg-frac286.5%
distribute-rgt-neg-in86.5%
neg-sub086.5%
associate--r-86.5%
neg-sub086.5%
mul-1-neg86.5%
+-commutative86.5%
mul-1-neg86.5%
unsub-neg86.5%
Simplified86.5%
Final simplification67.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* z (- z t)))))
(*
x_s
(if (<= z -1.5e-62)
t_1
(if (<= z 6.8e-113)
(/ (/ x_m y) t)
(if (or (<= z 4.5e-68) (not (<= z 1.25e-52))) t_1 (/ x_m (* y t))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
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 (z <= -1.5e-62) {
tmp = t_1;
} else if (z <= 6.8e-113) {
tmp = (x_m / y) / t;
} else if ((z <= 4.5e-68) || !(z <= 1.25e-52)) {
tmp = t_1;
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 (z <= (-1.5d-62)) then
tmp = t_1
else if (z <= 6.8d-113) then
tmp = (x_m / y) / t
else if ((z <= 4.5d-68) .or. (.not. (z <= 1.25d-52))) then
tmp = t_1
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);
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 (z <= -1.5e-62) {
tmp = t_1;
} else if (z <= 6.8e-113) {
tmp = (x_m / y) / t;
} else if ((z <= 4.5e-68) || !(z <= 1.25e-52)) {
tmp = t_1;
} else {
tmp = x_m / (y * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = x_m / (z * (z - t)) tmp = 0 if z <= -1.5e-62: tmp = t_1 elif z <= 6.8e-113: tmp = (x_m / y) / t elif (z <= 4.5e-68) or not (z <= 1.25e-52): tmp = t_1 else: tmp = x_m / (y * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m / Float64(z * Float64(z - t))) tmp = 0.0 if (z <= -1.5e-62) tmp = t_1; elseif (z <= 6.8e-113) tmp = Float64(Float64(x_m / y) / t); elseif ((z <= 4.5e-68) || !(z <= 1.25e-52)) tmp = t_1; 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); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = x_m / (z * (z - t)); tmp = 0.0; if (z <= -1.5e-62) tmp = t_1; elseif (z <= 6.8e-113) tmp = (x_m / y) / t; elseif ((z <= 4.5e-68) || ~((z <= 1.25e-52))) tmp = t_1; 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.5e-62], t$95$1, If[LessEqual[z, 6.8e-113], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, 4.5e-68], N[Not[LessEqual[z, 1.25e-52]], $MachinePrecision]], t$95$1, 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)
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-68} \lor \neg \left(z \leq 1.25 \cdot 10^{-52}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
\end{array}
if z < -1.5000000000000001e-62 or 6.8000000000000005e-113 < z < 4.49999999999999999e-68 or 1.25e-52 < z Initial program 83.4%
Taylor expanded in y around 0 69.3%
mul-1-neg69.3%
distribute-neg-frac269.3%
distribute-rgt-neg-in69.3%
neg-sub069.3%
associate--r-69.3%
neg-sub069.3%
mul-1-neg69.3%
+-commutative69.3%
mul-1-neg69.3%
unsub-neg69.3%
Simplified69.3%
if -1.5000000000000001e-62 < z < 6.8000000000000005e-113Initial program 91.8%
Taylor expanded in t around inf 83.4%
*-commutative83.4%
associate-/r*89.1%
Simplified89.1%
Taylor expanded in y around inf 78.4%
if 4.49999999999999999e-68 < z < 1.25e-52Initial program 100.0%
Taylor expanded in z around 0 75.9%
Final simplification72.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -2.8e+22)
(/ (/ x_m y) (- t z))
(if (<= t 2.7e+121) (/ x_m (* (- y z) (- t z))) (/ (/ x_m (- y z)) t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -2.8e+22) {
tmp = (x_m / y) / (t - z);
} else if (t <= 2.7e+121) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = (x_m / (y - z)) / t;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.8d+22)) then
tmp = (x_m / y) / (t - z)
else if (t <= 2.7d+121) then
tmp = x_m / ((y - z) * (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);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -2.8e+22) {
tmp = (x_m / y) / (t - z);
} else if (t <= 2.7e+121) {
tmp = x_m / ((y - z) * (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) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -2.8e+22: tmp = (x_m / y) / (t - z) elif t <= 2.7e+121: tmp = x_m / ((y - z) * (t - z)) else: tmp = (x_m / (y - z)) / t return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -2.8e+22) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 2.7e+121) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); 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); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (t <= -2.8e+22) tmp = (x_m / y) / (t - z); elseif (t <= 2.7e+121) tmp = x_m / ((y - z) * (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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -2.8e+22], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e+121], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $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\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+22}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+121}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
\end{array}
\end{array}
if t < -2.8e22Initial program 88.4%
associate-/r*98.3%
Applied egg-rr98.3%
Taylor expanded in y around inf 64.1%
if -2.8e22 < t < 2.7000000000000002e121Initial program 89.3%
if 2.7000000000000002e121 < t Initial program 74.0%
Taylor expanded in t around inf 74.0%
*-commutative74.0%
associate-/r*92.2%
Simplified92.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -2.15e-5)
(/ (/ x_m y) (- t z))
(if (<= y 2.3e-155) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.15e-5) {
tmp = (x_m / y) / (t - z);
} else if (y <= 2.3e-155) {
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)
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.15d-5)) then
tmp = (x_m / y) / (t - z)
else if (y <= 2.3d-155) 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);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.15e-5) {
tmp = (x_m / y) / (t - z);
} else if (y <= 2.3e-155) {
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) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -2.15e-5: tmp = (x_m / y) / (t - z) elif y <= 2.3e-155: 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) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -2.15e-5) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (y <= 2.3e-155) 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); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -2.15e-5) tmp = (x_m / y) / (t - z); elseif (y <= 2.3e-155) 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -2.15e-5], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e-155], 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\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-155}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.1500000000000001e-5Initial program 81.3%
associate-/r*98.2%
Applied egg-rr98.2%
Taylor expanded in y around inf 84.7%
if -2.1500000000000001e-5 < y < 2.30000000000000005e-155Initial program 92.3%
associate-/r*97.7%
Applied egg-rr97.7%
Taylor expanded in y around 0 84.1%
associate-*r/84.1%
neg-mul-184.1%
Simplified84.1%
if 2.30000000000000005e-155 < y Initial program 85.1%
Taylor expanded in t around inf 54.2%
*-commutative54.2%
associate-/r*62.8%
Simplified62.8%
associate-/l/54.2%
associate-/r*58.7%
Applied egg-rr58.7%
Final simplification73.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -4e-7)
(/ x_m (* y (- t z)))
(if (<= y 5.2e-119) (/ x_m (* z (- z t))) (/ (/ 1.0 y) (/ t x_m))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -4e-7) {
tmp = x_m / (y * (t - z));
} else if (y <= 5.2e-119) {
tmp = x_m / (z * (z - t));
} else {
tmp = (1.0 / y) / (t / x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 <= (-4d-7)) then
tmp = x_m / (y * (t - z))
else if (y <= 5.2d-119) then
tmp = x_m / (z * (z - t))
else
tmp = (1.0d0 / y) / (t / x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -4e-7) {
tmp = x_m / (y * (t - z));
} else if (y <= 5.2e-119) {
tmp = x_m / (z * (z - t));
} else {
tmp = (1.0 / y) / (t / x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -4e-7: tmp = x_m / (y * (t - z)) elif y <= 5.2e-119: tmp = x_m / (z * (z - t)) else: tmp = (1.0 / y) / (t / x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -4e-7) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 5.2e-119) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = Float64(Float64(1.0 / y) / Float64(t / x_m)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -4e-7) tmp = x_m / (y * (t - z)); elseif (y <= 5.2e-119) tmp = x_m / (z * (z - t)); else tmp = (1.0 / y) / (t / x_m); 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -4e-7], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-119], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] / N[(t / x$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-7}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-119}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y}}{\frac{t}{x\_m}}\\
\end{array}
\end{array}
if y < -3.9999999999999998e-7Initial program 81.3%
Taylor expanded in y around inf 77.9%
*-commutative77.9%
Simplified77.9%
if -3.9999999999999998e-7 < y < 5.20000000000000023e-119Initial program 92.8%
Taylor expanded in y around 0 80.5%
mul-1-neg80.5%
distribute-neg-frac280.5%
distribute-rgt-neg-in80.5%
neg-sub080.5%
associate--r-80.5%
neg-sub080.5%
mul-1-neg80.5%
+-commutative80.5%
mul-1-neg80.5%
unsub-neg80.5%
Simplified80.5%
if 5.20000000000000023e-119 < y Initial program 84.2%
Taylor expanded in z around 0 46.4%
associate-/r*49.3%
Applied egg-rr49.3%
div-inv49.3%
clear-num49.2%
associate-*l/50.2%
*-un-lft-identity50.2%
Applied egg-rr50.2%
Final simplification68.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -2.3e-7)
(/ x_m (* y (- t z)))
(if (<= y 8.2e-121) (/ x_m (* z (- z t))) (/ (/ x_m t) y)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.3e-7) {
tmp = x_m / (y * (t - z));
} else if (y <= 8.2e-121) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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.3d-7)) then
tmp = x_m / (y * (t - z))
else if (y <= 8.2d-121) then
tmp = x_m / (z * (z - t))
else
tmp = (x_m / t) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -2.3e-7) {
tmp = x_m / (y * (t - z));
} else if (y <= 8.2e-121) {
tmp = x_m / (z * (z - t));
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -2.3e-7: tmp = x_m / (y * (t - z)) elif y <= 8.2e-121: tmp = x_m / (z * (z - t)) else: tmp = (x_m / t) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -2.3e-7) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 8.2e-121) tmp = Float64(x_m / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -2.3e-7) tmp = x_m / (y * (t - z)); elseif (y <= 8.2e-121) tmp = x_m / (z * (z - t)); else tmp = (x_m / t) / y; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -2.3e-7], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-121], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $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\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-7}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-121}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if y < -2.29999999999999995e-7Initial program 81.3%
Taylor expanded in y around inf 77.9%
*-commutative77.9%
Simplified77.9%
if -2.29999999999999995e-7 < y < 8.19999999999999965e-121Initial program 92.7%
Taylor expanded in y around 0 81.3%
mul-1-neg81.3%
distribute-neg-frac281.3%
distribute-rgt-neg-in81.3%
neg-sub081.3%
associate--r-81.3%
neg-sub081.3%
mul-1-neg81.3%
+-commutative81.3%
mul-1-neg81.3%
unsub-neg81.3%
Simplified81.3%
if 8.19999999999999965e-121 < y Initial program 84.4%
Taylor expanded in z around 0 46.9%
associate-/r*49.8%
Applied egg-rr49.8%
Final simplification68.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -4.05e-109)
(/ (/ x_m y) t)
(if (<= y 4e-121) (/ (/ x_m (- z)) t) (/ (/ x_m t) y)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -4.05e-109) {
tmp = (x_m / y) / t;
} else if (y <= 4e-121) {
tmp = (x_m / -z) / t;
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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.05d-109)) then
tmp = (x_m / y) / t
else if (y <= 4d-121) then
tmp = (x_m / -z) / t
else
tmp = (x_m / t) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -4.05e-109) {
tmp = (x_m / y) / t;
} else if (y <= 4e-121) {
tmp = (x_m / -z) / t;
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -4.05e-109: tmp = (x_m / y) / t elif y <= 4e-121: tmp = (x_m / -z) / t else: tmp = (x_m / t) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -4.05e-109) tmp = Float64(Float64(x_m / y) / t); elseif (y <= 4e-121) tmp = Float64(Float64(x_m / Float64(-z)) / t); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -4.05e-109) tmp = (x_m / y) / t; elseif (y <= 4e-121) tmp = (x_m / -z) / t; else tmp = (x_m / t) / y; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -4.05e-109], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 4e-121], N[(N[(x$95$m / (-z)), $MachinePrecision] / t), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4.05 \cdot 10^{-109}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{x\_m}{-z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if y < -4.0500000000000001e-109Initial program 83.9%
Taylor expanded in t around inf 58.8%
*-commutative58.8%
associate-/r*68.8%
Simplified68.8%
Taylor expanded in y around inf 56.4%
if -4.0500000000000001e-109 < y < 3.9999999999999999e-121Initial program 93.6%
Taylor expanded in t around inf 58.5%
*-commutative58.5%
associate-/r*64.1%
Simplified64.1%
Taylor expanded in y around 0 56.1%
associate-*r/90.5%
neg-mul-190.5%
Simplified56.1%
if 3.9999999999999999e-121 < y Initial program 84.4%
Taylor expanded in z around 0 46.9%
associate-/r*49.8%
Applied egg-rr49.8%
Final simplification53.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= y -1.06e-108)
(/ (/ x_m y) t)
(if (<= y 5.4e-121) (/ (- x_m) (* z t)) (/ (/ x_m t) y)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -1.06e-108) {
tmp = (x_m / y) / t;
} else if (y <= 5.4e-121) {
tmp = -x_m / (z * t);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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.06d-108)) then
tmp = (x_m / y) / t
else if (y <= 5.4d-121) then
tmp = -x_m / (z * t)
else
tmp = (x_m / t) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -1.06e-108) {
tmp = (x_m / y) / t;
} else if (y <= 5.4e-121) {
tmp = -x_m / (z * t);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -1.06e-108: tmp = (x_m / y) / t elif y <= 5.4e-121: tmp = -x_m / (z * t) else: tmp = (x_m / t) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -1.06e-108) tmp = Float64(Float64(x_m / y) / t); elseif (y <= 5.4e-121) tmp = Float64(Float64(-x_m) / Float64(z * t)); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -1.06e-108) tmp = (x_m / y) / t; elseif (y <= 5.4e-121) tmp = -x_m / (z * t); else tmp = (x_m / t) / y; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -1.06e-108], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 5.4e-121], N[((-x$95$m) / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{-108}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-121}:\\
\;\;\;\;\frac{-x\_m}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if y < -1.06e-108Initial program 83.9%
Taylor expanded in t around inf 58.8%
*-commutative58.8%
associate-/r*68.8%
Simplified68.8%
Taylor expanded in y around inf 56.4%
if -1.06e-108 < y < 5.4000000000000004e-121Initial program 93.6%
Taylor expanded in t around inf 58.5%
*-commutative58.5%
associate-/r*64.1%
Simplified64.1%
Taylor expanded in y around 0 53.0%
associate-*r/53.0%
neg-mul-153.0%
Simplified53.0%
if 5.4000000000000004e-121 < y Initial program 84.4%
Taylor expanded in z around 0 46.9%
associate-/r*49.8%
Applied egg-rr49.8%
Final simplification52.8%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= y -3e-92) (/ (/ x_m y) t) (/ (/ x_m t) y))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -3e-92) {
tmp = (x_m / y) / t;
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 <= (-3d-92)) then
tmp = (x_m / y) / t
else
tmp = (x_m / t) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (y <= -3e-92) {
tmp = (x_m / y) / t;
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if y <= -3e-92: tmp = (x_m / y) / t else: tmp = (x_m / t) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (y <= -3e-92) tmp = Float64(Float64(x_m / y) / t); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (y <= -3e-92) tmp = (x_m / y) / t; else tmp = (x_m / t) / y; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -3e-92], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-92}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if y < -3.00000000000000013e-92Initial program 83.5%
Taylor expanded in t around inf 58.0%
*-commutative58.0%
associate-/r*68.1%
Simplified68.1%
Taylor expanded in y around inf 56.4%
if -3.00000000000000013e-92 < y Initial program 88.3%
Taylor expanded in z around 0 34.9%
associate-/r*40.5%
Applied egg-rr40.5%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ (/ x_m (- y z)) (- t z))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((x_m / (y - z)) / (t - z));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * ((x_m / (y - z)) / (t - z))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((x_m / (y - z)) / (t - z));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * ((x_m / (y - z)) / (t - z))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(Float64(x_m / Float64(y - z)) / Float64(t - z))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * ((x_m / (y - z)) / (t - z)); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \frac{\frac{x\_m}{y - z}}{t - z}
\end{array}
Initial program 86.9%
associate-/r*98.2%
Applied egg-rr98.2%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ (/ x_m (- t z)) (- y z))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((x_m / (t - z)) / (y - z));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 / (t - z)) / (y - z))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((x_m / (t - z)) / (y - z));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * ((x_m / (t - z)) / (y - z))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(Float64(x_m / Float64(t - z)) / Float64(y - z))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * ((x_m / (t - z)) / (y - z)); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * 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\_s \cdot \frac{\frac{x\_m}{t - z}}{y - z}
\end{array}
Initial program 86.9%
Taylor expanded in x around 0 86.9%
associate-/r*97.2%
Simplified97.2%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ (/ x_m t) y)))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((x_m / t) / y);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
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 / t) / y)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((x_m / t) / y);
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * ((x_m / t) / y)
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(Float64(x_m / t) / y)) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * ((x_m / t) / y); 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]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * 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\_s \cdot \frac{\frac{x\_m}{t}}{y}
\end{array}
Initial program 86.9%
Taylor expanded in z around 0 39.3%
associate-/r*44.8%
Applied egg-rr44.8%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (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);
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)
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);
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) 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) 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); 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]
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\_s \cdot \frac{x\_m}{y \cdot t}
\end{array}
Initial program 86.9%
Taylor expanded in z around 0 39.3%
Final simplification39.3%
(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 2024095
(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))))