
(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 19 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
(*
x_s
(if (<= (/ x_m (* (- y z) (- t z))) -1e-310)
(* x_m (/ (/ -1.0 (- z y)) (- t z)))
(/ (/ 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 tmp;
if ((x_m / ((y - z) * (t - z))) <= -1e-310) {
tmp = x_m * ((-1.0 / (z - y)) / (t - z));
} 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) :: tmp
if ((x_m / ((y - z) * (t - z))) <= (-1d-310)) then
tmp = x_m * (((-1.0d0) / (z - y)) / (t - z))
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 tmp;
if ((x_m / ((y - z) * (t - z))) <= -1e-310) {
tmp = x_m * ((-1.0 / (z - y)) / (t - z));
} 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): tmp = 0 if (x_m / ((y - z) * (t - z))) <= -1e-310: tmp = x_m * ((-1.0 / (z - y)) / (t - z)) 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) tmp = 0.0 if (Float64(x_m / Float64(Float64(y - z) * Float64(t - z))) <= -1e-310) tmp = Float64(x_m * Float64(Float64(-1.0 / Float64(z - y)) / Float64(t - z))); 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)
tmp = 0.0;
if ((x_m / ((y - z) * (t - z))) <= -1e-310)
tmp = x_m * ((-1.0 / (z - y)) / (t - z));
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_] := N[(x$95$s * If[LessEqual[N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-310], N[(x$95$m * N[(N[(-1.0 / N[(z - y), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)} \leq -1 \cdot 10^{-310}:\\
\;\;\;\;x\_m \cdot \frac{\frac{-1}{z - y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -9.999999999999969e-311Initial program 99.6%
associate-/l/94.4%
div-inv94.4%
div-inv94.1%
associate-*l*99.4%
Applied egg-rr99.4%
associate-*l/99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
if -9.999999999999969e-311 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 85.9%
associate-/l/98.4%
Simplified98.4%
Final simplification98.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -3.4e-37)
(/ (/ x_m z) (- z y))
(if (<= z 2.4e-179)
(* x_m (/ (/ 1.0 y) (- t z)))
(if (<= z 3.8e-70)
(* (/ -1.0 (- z y)) (/ x_m t))
(if (<= z 5.2e+88)
(* (/ x_m (- t z)) (/ 1.0 y))
(/ -1.0 (* z (/ (- t z) x_m)))))))))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 <= -3.4e-37) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.4e-179) {
tmp = x_m * ((1.0 / y) / (t - z));
} else if (z <= 3.8e-70) {
tmp = (-1.0 / (z - y)) * (x_m / t);
} else if (z <= 5.2e+88) {
tmp = (x_m / (t - z)) * (1.0 / y);
} else {
tmp = -1.0 / (z * ((t - z) / x_m));
}
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 <= (-3.4d-37)) then
tmp = (x_m / z) / (z - y)
else if (z <= 2.4d-179) then
tmp = x_m * ((1.0d0 / y) / (t - z))
else if (z <= 3.8d-70) then
tmp = ((-1.0d0) / (z - y)) * (x_m / t)
else if (z <= 5.2d+88) then
tmp = (x_m / (t - z)) * (1.0d0 / y)
else
tmp = (-1.0d0) / (z * ((t - z) / x_m))
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 <= -3.4e-37) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.4e-179) {
tmp = x_m * ((1.0 / y) / (t - z));
} else if (z <= 3.8e-70) {
tmp = (-1.0 / (z - y)) * (x_m / t);
} else if (z <= 5.2e+88) {
tmp = (x_m / (t - z)) * (1.0 / y);
} else {
tmp = -1.0 / (z * ((t - z) / x_m));
}
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 <= -3.4e-37: tmp = (x_m / z) / (z - y) elif z <= 2.4e-179: tmp = x_m * ((1.0 / y) / (t - z)) elif z <= 3.8e-70: tmp = (-1.0 / (z - y)) * (x_m / t) elif z <= 5.2e+88: tmp = (x_m / (t - z)) * (1.0 / y) else: tmp = -1.0 / (z * ((t - z) / x_m)) 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 <= -3.4e-37) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 2.4e-179) tmp = Float64(x_m * Float64(Float64(1.0 / y) / Float64(t - z))); elseif (z <= 3.8e-70) tmp = Float64(Float64(-1.0 / Float64(z - y)) * Float64(x_m / t)); elseif (z <= 5.2e+88) tmp = Float64(Float64(x_m / Float64(t - z)) * Float64(1.0 / y)); else tmp = Float64(-1.0 / Float64(z * Float64(Float64(t - z) / x_m))); 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 <= -3.4e-37)
tmp = (x_m / z) / (z - y);
elseif (z <= 2.4e-179)
tmp = x_m * ((1.0 / y) / (t - z));
elseif (z <= 3.8e-70)
tmp = (-1.0 / (z - y)) * (x_m / t);
elseif (z <= 5.2e+88)
tmp = (x_m / (t - z)) * (1.0 / y);
else
tmp = -1.0 / (z * ((t - z) / 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]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -3.4e-37], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-179], N[(x$95$m * N[(N[(1.0 / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-70], N[(N[(-1.0 / N[(z - y), $MachinePrecision]), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+88], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(z * N[(N[(t - z), $MachinePrecision] / x$95$m), $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 -3.4 \cdot 10^{-37}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-179}:\\
\;\;\;\;x\_m \cdot \frac{\frac{1}{y}}{t - z}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-70}:\\
\;\;\;\;\frac{-1}{z - y} \cdot \frac{x\_m}{t}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+88}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{z \cdot \frac{t - z}{x\_m}}\\
\end{array}
\end{array}
if z < -3.40000000000000018e-37Initial program 86.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 84.5%
associate-*r/84.5%
neg-mul-184.5%
Simplified84.5%
if -3.40000000000000018e-37 < z < 2.4e-179Initial program 99.6%
Taylor expanded in x around 0 99.6%
associate-/l/92.2%
Simplified92.2%
Taylor expanded in y around inf 80.1%
div-inv80.1%
associate-/l*87.2%
Applied egg-rr87.2%
if 2.4e-179 < z < 3.7999999999999998e-70Initial program 92.3%
associate-/l/96.0%
Simplified96.0%
Taylor expanded in t around inf 77.3%
div-inv77.3%
Applied egg-rr77.3%
if 3.7999999999999998e-70 < z < 5.2000000000000001e88Initial program 99.8%
associate-/l/99.9%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 86.1%
if 5.2000000000000001e88 < z Initial program 72.3%
associate-/l/99.8%
div-inv99.8%
div-inv99.7%
associate-*l*73.3%
Applied egg-rr73.3%
Taylor expanded in y around 0 69.7%
associate-*r/69.7%
*-commutative69.7%
frac-times94.0%
clear-num94.0%
frac-times95.2%
metadata-eval95.2%
Applied egg-rr95.2%
Final simplification87.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ (/ 1.0 y) (- t z)))))
(*
x_s
(if (<= z -4.8e-37)
(/ (/ x_m z) (- z y))
(if (<= z 2.65e-179)
t_1
(if (<= z 1.9e-69)
(* (/ -1.0 (- z y)) (/ x_m t))
(if (<= z 3.2e+88) t_1 (/ (/ 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 t_1 = x_m * ((1.0 / y) / (t - z));
double tmp;
if (z <= -4.8e-37) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.65e-179) {
tmp = t_1;
} else if (z <= 1.9e-69) {
tmp = (-1.0 / (z - y)) * (x_m / t);
} else if (z <= 3.2e+88) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x_m * ((1.0d0 / y) / (t - z))
if (z <= (-4.8d-37)) then
tmp = (x_m / z) / (z - y)
else if (z <= 2.65d-179) then
tmp = t_1
else if (z <= 1.9d-69) then
tmp = ((-1.0d0) / (z - y)) * (x_m / t)
else if (z <= 3.2d+88) then
tmp = t_1
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 t_1 = x_m * ((1.0 / y) / (t - z));
double tmp;
if (z <= -4.8e-37) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.65e-179) {
tmp = t_1;
} else if (z <= 1.9e-69) {
tmp = (-1.0 / (z - y)) * (x_m / t);
} else if (z <= 3.2e+88) {
tmp = t_1;
} 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): t_1 = x_m * ((1.0 / y) / (t - z)) tmp = 0 if z <= -4.8e-37: tmp = (x_m / z) / (z - y) elif z <= 2.65e-179: tmp = t_1 elif z <= 1.9e-69: tmp = (-1.0 / (z - y)) * (x_m / t) elif z <= 3.2e+88: tmp = t_1 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) t_1 = Float64(x_m * Float64(Float64(1.0 / y) / Float64(t - z))) tmp = 0.0 if (z <= -4.8e-37) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 2.65e-179) tmp = t_1; elseif (z <= 1.9e-69) tmp = Float64(Float64(-1.0 / Float64(z - y)) * Float64(x_m / t)); elseif (z <= 3.2e+88) tmp = t_1; else tmp = Float64(Float64(x_m / 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)
t_1 = x_m * ((1.0 / y) / (t - z));
tmp = 0.0;
if (z <= -4.8e-37)
tmp = (x_m / z) / (z - y);
elseif (z <= 2.65e-179)
tmp = t_1;
elseif (z <= 1.9e-69)
tmp = (-1.0 / (z - y)) * (x_m / t);
elseif (z <= 3.2e+88)
tmp = t_1;
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_] := Block[{t$95$1 = N[(x$95$m * N[(N[(1.0 / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -4.8e-37], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.65e-179], t$95$1, If[LessEqual[z, 1.9e-69], N[(N[(-1.0 / N[(z - y), $MachinePrecision]), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+88], t$95$1, N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{\frac{1}{y}}{t - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-37}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-69}:\\
\;\;\;\;\frac{-1}{z - y} \cdot \frac{x\_m}{t}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\end{array}
\end{array}
\end{array}
if z < -4.79999999999999982e-37Initial program 86.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 84.5%
associate-*r/84.5%
neg-mul-184.5%
Simplified84.5%
if -4.79999999999999982e-37 < z < 2.64999999999999997e-179 or 1.8999999999999999e-69 < z < 3.1999999999999999e88Initial program 99.7%
Taylor expanded in x around 0 99.7%
associate-/l/93.9%
Simplified93.9%
Taylor expanded in y around inf 80.3%
div-inv80.3%
associate-/l*85.9%
Applied egg-rr85.9%
if 2.64999999999999997e-179 < z < 1.8999999999999999e-69Initial program 92.3%
associate-/l/96.0%
Simplified96.0%
Taylor expanded in t around inf 77.3%
div-inv77.3%
Applied egg-rr77.3%
if 3.1999999999999999e88 < z Initial program 72.3%
Taylor expanded in x around 0 72.3%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 94.1%
associate-*r/94.1%
neg-mul-194.1%
Simplified94.1%
Final simplification86.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ (/ 1.0 y) (- t z)))))
(*
x_s
(if (<= z -7.5e-42)
(/ (/ x_m z) (- z y))
(if (<= z 2.6e-179)
t_1
(if (<= z 1.65e-62)
(/ (/ x_m t) (- y z))
(if (<= z 3.2e+88) t_1 (/ (/ 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 t_1 = x_m * ((1.0 / y) / (t - z));
double tmp;
if (z <= -7.5e-42) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.6e-179) {
tmp = t_1;
} else if (z <= 1.65e-62) {
tmp = (x_m / t) / (y - z);
} else if (z <= 3.2e+88) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x_m * ((1.0d0 / y) / (t - z))
if (z <= (-7.5d-42)) then
tmp = (x_m / z) / (z - y)
else if (z <= 2.6d-179) then
tmp = t_1
else if (z <= 1.65d-62) then
tmp = (x_m / t) / (y - z)
else if (z <= 3.2d+88) then
tmp = t_1
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 t_1 = x_m * ((1.0 / y) / (t - z));
double tmp;
if (z <= -7.5e-42) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.6e-179) {
tmp = t_1;
} else if (z <= 1.65e-62) {
tmp = (x_m / t) / (y - z);
} else if (z <= 3.2e+88) {
tmp = t_1;
} 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): t_1 = x_m * ((1.0 / y) / (t - z)) tmp = 0 if z <= -7.5e-42: tmp = (x_m / z) / (z - y) elif z <= 2.6e-179: tmp = t_1 elif z <= 1.65e-62: tmp = (x_m / t) / (y - z) elif z <= 3.2e+88: tmp = t_1 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) t_1 = Float64(x_m * Float64(Float64(1.0 / y) / Float64(t - z))) tmp = 0.0 if (z <= -7.5e-42) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 2.6e-179) tmp = t_1; elseif (z <= 1.65e-62) tmp = Float64(Float64(x_m / t) / Float64(y - z)); elseif (z <= 3.2e+88) tmp = t_1; else tmp = Float64(Float64(x_m / 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)
t_1 = x_m * ((1.0 / y) / (t - z));
tmp = 0.0;
if (z <= -7.5e-42)
tmp = (x_m / z) / (z - y);
elseif (z <= 2.6e-179)
tmp = t_1;
elseif (z <= 1.65e-62)
tmp = (x_m / t) / (y - z);
elseif (z <= 3.2e+88)
tmp = t_1;
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_] := Block[{t$95$1 = N[(x$95$m * N[(N[(1.0 / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -7.5e-42], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-179], t$95$1, If[LessEqual[z, 1.65e-62], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+88], t$95$1, N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{\frac{1}{y}}{t - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\end{array}
\end{array}
\end{array}
if z < -7.49999999999999972e-42Initial program 86.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 84.5%
associate-*r/84.5%
neg-mul-184.5%
Simplified84.5%
if -7.49999999999999972e-42 < z < 2.60000000000000005e-179 or 1.65000000000000002e-62 < z < 3.1999999999999999e88Initial program 99.7%
Taylor expanded in x around 0 99.7%
associate-/l/93.9%
Simplified93.9%
Taylor expanded in y around inf 80.3%
div-inv80.3%
associate-/l*85.9%
Applied egg-rr85.9%
if 2.60000000000000005e-179 < z < 1.65000000000000002e-62Initial program 92.3%
associate-/l/96.0%
Simplified96.0%
Taylor expanded in t around inf 77.3%
if 3.1999999999999999e88 < z Initial program 72.3%
Taylor expanded in x around 0 72.3%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 94.1%
associate-*r/94.1%
neg-mul-194.1%
Simplified94.1%
Final simplification86.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* y (- t z)))))
(*
x_s
(if (<= z -4.2e-40)
(/ (/ x_m z) (- z y))
(if (<= z 2.7e-179)
t_1
(if (<= z 2e-55)
(/ (/ x_m t) (- y z))
(if (<= z 1.8e+89) t_1 (/ (/ 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 t_1 = x_m / (y * (t - z));
double tmp;
if (z <= -4.2e-40) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.7e-179) {
tmp = t_1;
} else if (z <= 2e-55) {
tmp = (x_m / t) / (y - z);
} else if (z <= 1.8e+89) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x_m / (y * (t - z))
if (z <= (-4.2d-40)) then
tmp = (x_m / z) / (z - y)
else if (z <= 2.7d-179) then
tmp = t_1
else if (z <= 2d-55) then
tmp = (x_m / t) / (y - z)
else if (z <= 1.8d+89) then
tmp = t_1
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 t_1 = x_m / (y * (t - z));
double tmp;
if (z <= -4.2e-40) {
tmp = (x_m / z) / (z - y);
} else if (z <= 2.7e-179) {
tmp = t_1;
} else if (z <= 2e-55) {
tmp = (x_m / t) / (y - z);
} else if (z <= 1.8e+89) {
tmp = t_1;
} 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): t_1 = x_m / (y * (t - z)) tmp = 0 if z <= -4.2e-40: tmp = (x_m / z) / (z - y) elif z <= 2.7e-179: tmp = t_1 elif z <= 2e-55: tmp = (x_m / t) / (y - z) elif z <= 1.8e+89: tmp = t_1 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) t_1 = Float64(x_m / Float64(y * Float64(t - z))) tmp = 0.0 if (z <= -4.2e-40) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 2.7e-179) tmp = t_1; elseif (z <= 2e-55) tmp = Float64(Float64(x_m / t) / Float64(y - z)); elseif (z <= 1.8e+89) tmp = t_1; else tmp = Float64(Float64(x_m / 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)
t_1 = x_m / (y * (t - z));
tmp = 0.0;
if (z <= -4.2e-40)
tmp = (x_m / z) / (z - y);
elseif (z <= 2.7e-179)
tmp = t_1;
elseif (z <= 2e-55)
tmp = (x_m / t) / (y - z);
elseif (z <= 1.8e+89)
tmp = t_1;
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_] := Block[{t$95$1 = N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -4.2e-40], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-179], t$95$1, If[LessEqual[z, 2e-55], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+89], t$95$1, N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{y \cdot \left(t - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-40}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-55}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\
\end{array}
\end{array}
\end{array}
if z < -4.20000000000000036e-40Initial program 86.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around 0 84.5%
associate-*r/84.5%
neg-mul-184.5%
Simplified84.5%
if -4.20000000000000036e-40 < z < 2.69999999999999988e-179 or 1.99999999999999999e-55 < z < 1.8e89Initial program 99.7%
Taylor expanded in y around inf 85.9%
*-commutative85.9%
Simplified85.9%
if 2.69999999999999988e-179 < z < 1.99999999999999999e-55Initial program 92.3%
associate-/l/96.0%
Simplified96.0%
Taylor expanded in t around inf 77.3%
if 1.8e89 < z Initial program 72.3%
Taylor expanded in x around 0 72.3%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 94.1%
associate-*r/94.1%
neg-mul-194.1%
Simplified94.1%
Final simplification86.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* y (- t z)))) (t_2 (/ (/ x_m z) (- z t))))
(*
x_s
(if (<= z -3700000000000.0)
t_2
(if (<= z 2.7e-179)
t_1
(if (<= z 4.6e-60)
(/ (/ x_m t) (- y z))
(if (<= z 3.2e+88) 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 * (t - z));
double t_2 = (x_m / z) / (z - t);
double tmp;
if (z <= -3700000000000.0) {
tmp = t_2;
} else if (z <= 2.7e-179) {
tmp = t_1;
} else if (z <= 4.6e-60) {
tmp = (x_m / t) / (y - z);
} else if (z <= 3.2e+88) {
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 * (t - z))
t_2 = (x_m / z) / (z - t)
if (z <= (-3700000000000.0d0)) then
tmp = t_2
else if (z <= 2.7d-179) then
tmp = t_1
else if (z <= 4.6d-60) then
tmp = (x_m / t) / (y - z)
else if (z <= 3.2d+88) 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 * (t - z));
double t_2 = (x_m / z) / (z - t);
double tmp;
if (z <= -3700000000000.0) {
tmp = t_2;
} else if (z <= 2.7e-179) {
tmp = t_1;
} else if (z <= 4.6e-60) {
tmp = (x_m / t) / (y - z);
} else if (z <= 3.2e+88) {
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 * (t - z)) t_2 = (x_m / z) / (z - t) tmp = 0 if z <= -3700000000000.0: tmp = t_2 elif z <= 2.7e-179: tmp = t_1 elif z <= 4.6e-60: tmp = (x_m / t) / (y - z) elif z <= 3.2e+88: 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(t - z))) t_2 = Float64(Float64(x_m / z) / Float64(z - t)) tmp = 0.0 if (z <= -3700000000000.0) tmp = t_2; elseif (z <= 2.7e-179) tmp = t_1; elseif (z <= 4.6e-60) tmp = Float64(Float64(x_m / t) / Float64(y - z)); elseif (z <= 3.2e+88) 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 * (t - z));
t_2 = (x_m / z) / (z - t);
tmp = 0.0;
if (z <= -3700000000000.0)
tmp = t_2;
elseif (z <= 2.7e-179)
tmp = t_1;
elseif (z <= 4.6e-60)
tmp = (x_m / t) / (y - z);
elseif (z <= 3.2e+88)
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 * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3700000000000.0], t$95$2, If[LessEqual[z, 2.7e-179], t$95$1, If[LessEqual[z, 4.6e-60], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+88], 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(t - z\right)}\\
t_2 := \frac{\frac{x\_m}{z}}{z - t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3700000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-60}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -3.7e12 or 3.1999999999999999e88 < z Initial program 78.2%
Taylor expanded in x around 0 78.2%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 93.0%
associate-*r/93.0%
neg-mul-193.0%
Simplified93.0%
if -3.7e12 < z < 2.69999999999999988e-179 or 4.6000000000000003e-60 < z < 3.1999999999999999e88Initial program 99.7%
Taylor expanded in y around inf 82.6%
*-commutative82.6%
Simplified82.6%
if 2.69999999999999988e-179 < z < 4.6000000000000003e-60Initial program 92.3%
associate-/l/96.0%
Simplified96.0%
Taylor expanded in t around inf 77.3%
Final simplification87.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (* y (- t z)))) (t_2 (/ (/ x_m z) (+ z t))))
(*
x_s
(if (<= z -220000000.0)
t_2
(if (<= z 2.85e-179)
t_1
(if (<= z 3.2e-70)
(/ (/ x_m t) (- y z))
(if (<= z 9.4e+89) 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 * (t - z));
double t_2 = (x_m / z) / (z + t);
double tmp;
if (z <= -220000000.0) {
tmp = t_2;
} else if (z <= 2.85e-179) {
tmp = t_1;
} else if (z <= 3.2e-70) {
tmp = (x_m / t) / (y - z);
} else if (z <= 9.4e+89) {
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 * (t - z))
t_2 = (x_m / z) / (z + t)
if (z <= (-220000000.0d0)) then
tmp = t_2
else if (z <= 2.85d-179) then
tmp = t_1
else if (z <= 3.2d-70) then
tmp = (x_m / t) / (y - z)
else if (z <= 9.4d+89) 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 * (t - z));
double t_2 = (x_m / z) / (z + t);
double tmp;
if (z <= -220000000.0) {
tmp = t_2;
} else if (z <= 2.85e-179) {
tmp = t_1;
} else if (z <= 3.2e-70) {
tmp = (x_m / t) / (y - z);
} else if (z <= 9.4e+89) {
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 * (t - z)) t_2 = (x_m / z) / (z + t) tmp = 0 if z <= -220000000.0: tmp = t_2 elif z <= 2.85e-179: tmp = t_1 elif z <= 3.2e-70: tmp = (x_m / t) / (y - z) elif z <= 9.4e+89: 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(t - z))) t_2 = Float64(Float64(x_m / z) / Float64(z + t)) tmp = 0.0 if (z <= -220000000.0) tmp = t_2; elseif (z <= 2.85e-179) tmp = t_1; elseif (z <= 3.2e-70) tmp = Float64(Float64(x_m / t) / Float64(y - z)); elseif (z <= 9.4e+89) 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 * (t - z));
t_2 = (x_m / z) / (z + t);
tmp = 0.0;
if (z <= -220000000.0)
tmp = t_2;
elseif (z <= 2.85e-179)
tmp = t_1;
elseif (z <= 3.2e-70)
tmp = (x_m / t) / (y - z);
elseif (z <= 9.4e+89)
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 * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m / z), $MachinePrecision] / N[(z + t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -220000000.0], t$95$2, If[LessEqual[z, 2.85e-179], t$95$1, If[LessEqual[z, 3.2e-70], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.4e+89], 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(t - z\right)}\\
t_2 := \frac{\frac{x\_m}{z}}{z + t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -220000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-70}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
\mathbf{elif}\;z \leq 9.4 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if z < -2.2e8 or 9.40000000000000043e89 < z Initial program 78.2%
associate-/l/99.8%
div-inv99.8%
div-inv99.7%
associate-*l*78.7%
Applied egg-rr78.7%
Taylor expanded in y around 0 76.0%
associate-*r/76.1%
*-commutative76.1%
neg-mul-176.1%
add-sqr-sqrt39.4%
sqrt-unprod65.0%
sqr-neg65.0%
sqrt-unprod32.7%
add-sqr-sqrt63.5%
Applied egg-rr63.5%
*-un-lft-identity63.5%
*-commutative63.5%
*-commutative63.5%
add-sqr-sqrt31.2%
sqrt-unprod70.6%
sqr-neg70.6%
sqrt-unprod39.5%
add-sqr-sqrt76.1%
distribute-lft-neg-in76.1%
distribute-lft-neg-in76.1%
add-sqr-sqrt39.5%
sqrt-unprod70.6%
sqr-neg70.6%
sqrt-unprod31.2%
add-sqr-sqrt63.5%
sub-neg63.5%
distribute-lft-in53.3%
add-sqr-sqrt27.2%
sqrt-unprod54.5%
sqr-neg54.5%
sqrt-unprod27.3%
add-sqr-sqrt63.5%
+-commutative63.5%
distribute-lft-out74.5%
Applied egg-rr74.5%
*-lft-identity74.5%
associate-/r*86.5%
Simplified86.5%
if -2.2e8 < z < 2.85e-179 or 3.1999999999999997e-70 < z < 9.40000000000000043e89Initial program 99.7%
Taylor expanded in y around inf 82.6%
*-commutative82.6%
Simplified82.6%
if 2.85e-179 < z < 3.1999999999999997e-70Initial program 92.3%
associate-/l/96.0%
Simplified96.0%
Taylor expanded in t around inf 77.3%
Final simplification83.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ x_m (- t z))))
(*
x_s
(if (<= y -1.4e+160)
(* t_1 (/ 1.0 y))
(if (<= y -8.6e-89)
(/ x_m (* y (- t z)))
(if (<= y 7e-133)
(* t_1 (/ -1.0 z))
(* (/ -1.0 (- z y)) (/ x_m 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 (y <= -1.4e+160) {
tmp = t_1 * (1.0 / y);
} else if (y <= -8.6e-89) {
tmp = x_m / (y * (t - z));
} else if (y <= 7e-133) {
tmp = t_1 * (-1.0 / z);
} else {
tmp = (-1.0 / (z - y)) * (x_m / 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 (y <= (-1.4d+160)) then
tmp = t_1 * (1.0d0 / y)
else if (y <= (-8.6d-89)) then
tmp = x_m / (y * (t - z))
else if (y <= 7d-133) then
tmp = t_1 * ((-1.0d0) / z)
else
tmp = ((-1.0d0) / (z - y)) * (x_m / 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 (y <= -1.4e+160) {
tmp = t_1 * (1.0 / y);
} else if (y <= -8.6e-89) {
tmp = x_m / (y * (t - z));
} else if (y <= 7e-133) {
tmp = t_1 * (-1.0 / z);
} else {
tmp = (-1.0 / (z - y)) * (x_m / 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 y <= -1.4e+160: tmp = t_1 * (1.0 / y) elif y <= -8.6e-89: tmp = x_m / (y * (t - z)) elif y <= 7e-133: tmp = t_1 * (-1.0 / z) else: tmp = (-1.0 / (z - y)) * (x_m / 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 - z)) tmp = 0.0 if (y <= -1.4e+160) tmp = Float64(t_1 * Float64(1.0 / y)); elseif (y <= -8.6e-89) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (y <= 7e-133) tmp = Float64(t_1 * Float64(-1.0 / z)); else tmp = Float64(Float64(-1.0 / Float64(z - y)) * Float64(x_m / 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 (y <= -1.4e+160)
tmp = t_1 * (1.0 / y);
elseif (y <= -8.6e-89)
tmp = x_m / (y * (t - z));
elseif (y <= 7e-133)
tmp = t_1 * (-1.0 / z);
else
tmp = (-1.0 / (z - y)) * (x_m / 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[y, -1.4e+160], N[(t$95$1 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8.6e-89], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-133], N[(t$95$1 * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(z - y), $MachinePrecision]), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{t - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+160}:\\
\;\;\;\;t\_1 \cdot \frac{1}{y}\\
\mathbf{elif}\;y \leq -8.6 \cdot 10^{-89}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-133}:\\
\;\;\;\;t\_1 \cdot \frac{-1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{z - y} \cdot \frac{x\_m}{t}\\
\end{array}
\end{array}
\end{array}
if y < -1.4e160Initial program 88.9%
associate-/l/99.9%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 96.5%
if -1.4e160 < y < -8.59999999999999974e-89Initial program 88.3%
Taylor expanded in y around inf 82.5%
*-commutative82.5%
Simplified82.5%
if -8.59999999999999974e-89 < y < 7.00000000000000006e-133Initial program 85.2%
associate-/l/97.7%
div-inv97.7%
Applied egg-rr97.7%
Taylor expanded in y around 0 85.5%
if 7.00000000000000006e-133 < y Initial program 92.8%
associate-/l/97.5%
Simplified97.5%
Taylor expanded in t around inf 62.8%
div-inv62.8%
Applied egg-rr62.8%
Final simplification78.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 (<= z -1.36e+163)
(/ (/ x_m z) (- z y))
(if (<= z 7.8e+98)
(/ x_m (* (- y z) (- t z)))
(/ -1.0 (* z (/ (- t z) x_m)))))))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.36e+163) {
tmp = (x_m / z) / (z - y);
} else if (z <= 7.8e+98) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = -1.0 / (z * ((t - z) / x_m));
}
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.36d+163)) then
tmp = (x_m / z) / (z - y)
else if (z <= 7.8d+98) then
tmp = x_m / ((y - z) * (t - z))
else
tmp = (-1.0d0) / (z * ((t - z) / x_m))
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.36e+163) {
tmp = (x_m / z) / (z - y);
} else if (z <= 7.8e+98) {
tmp = x_m / ((y - z) * (t - z));
} else {
tmp = -1.0 / (z * ((t - z) / x_m));
}
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.36e+163: tmp = (x_m / z) / (z - y) elif z <= 7.8e+98: tmp = x_m / ((y - z) * (t - z)) else: tmp = -1.0 / (z * ((t - z) / x_m)) 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.36e+163) tmp = Float64(Float64(x_m / z) / Float64(z - y)); elseif (z <= 7.8e+98) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(-1.0 / Float64(z * Float64(Float64(t - z) / x_m))); 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.36e+163)
tmp = (x_m / z) / (z - y);
elseif (z <= 7.8e+98)
tmp = x_m / ((y - z) * (t - z));
else
tmp = -1.0 / (z * ((t - z) / 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]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.36e+163], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+98], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(z * N[(N[(t - z), $MachinePrecision] / x$95$m), $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.36 \cdot 10^{+163}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+98}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{z \cdot \frac{t - z}{x\_m}}\\
\end{array}
\end{array}
if z < -1.36000000000000001e163Initial program 79.2%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around 0 91.5%
associate-*r/91.5%
neg-mul-191.5%
Simplified91.5%
if -1.36000000000000001e163 < z < 7.7999999999999999e98Initial program 97.3%
if 7.7999999999999999e98 < z Initial program 71.0%
associate-/l/99.8%
div-inv99.8%
div-inv99.7%
associate-*l*72.0%
Applied egg-rr72.0%
Taylor expanded in y around 0 69.8%
associate-*r/69.9%
*-commutative69.9%
frac-times95.4%
clear-num95.3%
frac-times96.6%
metadata-eval96.6%
Applied egg-rr96.6%
Final simplification96.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= z -1.75e+24) (not (<= z 3.7e+95)))
(/ x_m (* z (+ z t)))
(/ x_m (* (- y z) t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.75e+24) || !(z <= 3.7e+95)) {
tmp = x_m / (z * (z + t));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.75d+24)) .or. (.not. (z <= 3.7d+95))) then
tmp = x_m / (z * (z + t))
else
tmp = x_m / ((y - z) * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((z <= -1.75e+24) || !(z <= 3.7e+95)) {
tmp = x_m / (z * (z + t));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (z <= -1.75e+24) or not (z <= 3.7e+95): tmp = x_m / (z * (z + t)) else: tmp = x_m / ((y - z) * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((z <= -1.75e+24) || !(z <= 3.7e+95)) tmp = Float64(x_m / Float64(z * Float64(z + t))); 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 ((z <= -1.75e+24) || ~((z <= 3.7e+95)))
tmp = x_m / (z * (z + t));
else
tmp = x_m / ((y - z) * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.75e+24], N[Not[LessEqual[z, 3.7e+95]], $MachinePrecision]], N[(x$95$m / N[(z * N[(z + t), $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}\;z \leq -1.75 \cdot 10^{+24} \lor \neg \left(z \leq 3.7 \cdot 10^{+95}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -1.7500000000000001e24 or 3.7000000000000001e95 < z Initial program 77.9%
associate-/l/99.8%
div-inv99.8%
div-inv99.8%
associate-*l*78.4%
Applied egg-rr78.4%
Taylor expanded in y around 0 76.5%
associate-*r/76.5%
*-commutative76.5%
neg-mul-176.5%
add-sqr-sqrt40.0%
sqrt-unprod66.1%
sqr-neg66.1%
sqrt-unprod33.2%
add-sqr-sqrt64.4%
Applied egg-rr64.4%
*-un-lft-identity64.4%
*-commutative64.4%
*-commutative64.4%
add-sqr-sqrt31.6%
sqrt-unprod71.7%
sqr-neg71.7%
sqrt-unprod40.1%
add-sqr-sqrt76.5%
distribute-lft-neg-in76.5%
distribute-lft-neg-in76.5%
add-sqr-sqrt40.1%
sqrt-unprod71.7%
sqr-neg71.7%
sqrt-unprod31.6%
add-sqr-sqrt64.4%
sub-neg64.4%
distribute-lft-in54.1%
add-sqr-sqrt27.7%
sqrt-unprod54.5%
sqr-neg54.5%
sqrt-unprod26.9%
add-sqr-sqrt63.7%
+-commutative63.7%
distribute-lft-out74.9%
Applied egg-rr74.9%
*-lft-identity74.9%
Simplified74.9%
if -1.7500000000000001e24 < z < 3.7000000000000001e95Initial program 98.3%
Taylor expanded in t around inf 74.7%
Final simplification74.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= t -6.4e-134) (not (<= t 4.6e-94)))
(/ x_m (* (- y z) t))
(/ x_m (* z (- y))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((t <= -6.4e-134) || !(t <= 4.6e-94)) {
tmp = x_m / ((y - z) * t);
} else {
tmp = x_m / (z * -y);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-6.4d-134)) .or. (.not. (t <= 4.6d-94))) then
tmp = x_m / ((y - z) * t)
else
tmp = x_m / (z * -y)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((t <= -6.4e-134) || !(t <= 4.6e-94)) {
tmp = x_m / ((y - z) * t);
} else {
tmp = x_m / (z * -y);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if (t <= -6.4e-134) or not (t <= 4.6e-94): tmp = x_m / ((y - z) * t) else: tmp = x_m / (z * -y) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((t <= -6.4e-134) || !(t <= 4.6e-94)) tmp = Float64(x_m / Float64(Float64(y - z) * t)); else tmp = Float64(x_m / Float64(z * Float64(-y))); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((t <= -6.4e-134) || ~((t <= 4.6e-94)))
tmp = x_m / ((y - z) * t);
else
tmp = x_m / (z * -y);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[t, -6.4e-134], N[Not[LessEqual[t, 4.6e-94]], $MachinePrecision]], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(z * (-y)), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -6.4 \cdot 10^{-134} \lor \neg \left(t \leq 4.6 \cdot 10^{-94}\right):\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-y\right)}\\
\end{array}
\end{array}
if t < -6.4000000000000003e-134 or 4.5999999999999999e-94 < t Initial program 88.6%
Taylor expanded in t around inf 76.1%
if -6.4000000000000003e-134 < t < 4.5999999999999999e-94Initial program 89.0%
Taylor expanded in x around 0 89.0%
associate-/l/97.1%
Simplified97.1%
Taylor expanded in y around inf 56.1%
Taylor expanded in t around 0 49.9%
mul-1-neg49.9%
*-commutative49.9%
Simplified49.9%
Final simplification68.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.9e-209)
(/ (/ x_m y) (- t z))
(if (<= t 9.5e-28) (/ x_m (* z (+ z t))) (/ x_m (* (- y z) t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 2.9e-209) {
tmp = (x_m / y) / (t - z);
} else if (t <= 9.5e-28) {
tmp = x_m / (z * (z + t));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 2.9d-209) then
tmp = (x_m / y) / (t - z)
else if (t <= 9.5d-28) then
tmp = x_m / (z * (z + t))
else
tmp = x_m / ((y - z) * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 2.9e-209) {
tmp = (x_m / y) / (t - z);
} else if (t <= 9.5e-28) {
tmp = x_m / (z * (z + t));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= 2.9e-209: tmp = (x_m / y) / (t - z) elif t <= 9.5e-28: tmp = x_m / (z * (z + t)) else: tmp = x_m / ((y - z) * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= 2.9e-209) tmp = Float64(Float64(x_m / y) / Float64(t - z)); elseif (t <= 9.5e-28) tmp = Float64(x_m / Float64(z * Float64(z + t))); else tmp = Float64(x_m / Float64(Float64(y - z) * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= 2.9e-209)
tmp = (x_m / y) / (t - z);
elseif (t <= 9.5e-28)
tmp = x_m / (z * (z + t));
else
tmp = x_m / ((y - z) * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 2.9e-209], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e-28], N[(x$95$m / N[(z * N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq 2.9 \cdot 10^{-209}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 2.90000000000000026e-209Initial program 86.9%
Taylor expanded in x around 0 86.9%
associate-/l/95.9%
Simplified95.9%
Taylor expanded in y around inf 60.2%
if 2.90000000000000026e-209 < t < 9.50000000000000001e-28Initial program 91.9%
associate-/l/99.9%
div-inv99.8%
div-inv99.6%
associate-*l*91.8%
Applied egg-rr91.8%
Taylor expanded in y around 0 61.9%
associate-*r/61.9%
*-commutative61.9%
neg-mul-161.9%
add-sqr-sqrt37.5%
sqrt-unprod44.3%
sqr-neg44.3%
sqrt-unprod19.9%
add-sqr-sqrt45.5%
Applied egg-rr45.5%
*-un-lft-identity45.5%
*-commutative45.5%
*-commutative45.5%
add-sqr-sqrt17.6%
sqrt-unprod52.6%
sqr-neg52.6%
sqrt-unprod34.9%
add-sqr-sqrt61.9%
distribute-lft-neg-in61.9%
distribute-lft-neg-in61.9%
add-sqr-sqrt34.9%
sqrt-unprod52.6%
sqr-neg52.6%
sqrt-unprod17.6%
add-sqr-sqrt45.5%
sub-neg45.5%
distribute-lft-in45.5%
add-sqr-sqrt27.9%
sqrt-unprod57.3%
sqr-neg57.3%
sqrt-unprod29.3%
add-sqr-sqrt64.2%
+-commutative64.2%
distribute-lft-out64.1%
Applied egg-rr64.1%
*-lft-identity64.1%
Simplified64.1%
if 9.50000000000000001e-28 < t Initial program 90.9%
Taylor expanded in t around inf 85.0%
Final simplification66.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t 4.2e-202)
(/ x_m (* y (- t z)))
(if (<= t 9.5e-28) (/ x_m (* z (+ z t))) (/ x_m (* (- y z) t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 4.2e-202) {
tmp = x_m / (y * (t - z));
} else if (t <= 9.5e-28) {
tmp = x_m / (z * (z + t));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 4.2d-202) then
tmp = x_m / (y * (t - z))
else if (t <= 9.5d-28) then
tmp = x_m / (z * (z + t))
else
tmp = x_m / ((y - z) * t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= 4.2e-202) {
tmp = x_m / (y * (t - z));
} else if (t <= 9.5e-28) {
tmp = x_m / (z * (z + t));
} else {
tmp = x_m / ((y - z) * t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= 4.2e-202: tmp = x_m / (y * (t - z)) elif t <= 9.5e-28: tmp = x_m / (z * (z + t)) else: tmp = x_m / ((y - z) * t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= 4.2e-202) tmp = Float64(x_m / Float64(y * Float64(t - z))); elseif (t <= 9.5e-28) tmp = Float64(x_m / Float64(z * Float64(z + t))); 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 <= 4.2e-202)
tmp = x_m / (y * (t - z));
elseif (t <= 9.5e-28)
tmp = x_m / (z * (z + t));
else
tmp = x_m / ((y - z) * t);
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 4.2e-202], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e-28], N[(x$95$m / N[(z * N[(z + t), $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 4.2 \cdot 10^{-202}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(z + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 4.1999999999999997e-202Initial program 86.9%
Taylor expanded in y around inf 61.4%
*-commutative61.4%
Simplified61.4%
if 4.1999999999999997e-202 < t < 9.50000000000000001e-28Initial program 91.9%
associate-/l/99.9%
div-inv99.8%
div-inv99.6%
associate-*l*91.8%
Applied egg-rr91.8%
Taylor expanded in y around 0 61.9%
associate-*r/61.9%
*-commutative61.9%
neg-mul-161.9%
add-sqr-sqrt37.5%
sqrt-unprod44.3%
sqr-neg44.3%
sqrt-unprod19.9%
add-sqr-sqrt45.5%
Applied egg-rr45.5%
*-un-lft-identity45.5%
*-commutative45.5%
*-commutative45.5%
add-sqr-sqrt17.6%
sqrt-unprod52.6%
sqr-neg52.6%
sqrt-unprod34.9%
add-sqr-sqrt61.9%
distribute-lft-neg-in61.9%
distribute-lft-neg-in61.9%
add-sqr-sqrt34.9%
sqrt-unprod52.6%
sqr-neg52.6%
sqrt-unprod17.6%
add-sqr-sqrt45.5%
sub-neg45.5%
distribute-lft-in45.5%
add-sqr-sqrt27.9%
sqrt-unprod57.3%
sqr-neg57.3%
sqrt-unprod29.3%
add-sqr-sqrt64.2%
+-commutative64.2%
distribute-lft-out64.1%
Applied egg-rr64.1%
*-lft-identity64.1%
Simplified64.1%
if 9.50000000000000001e-28 < t Initial program 90.9%
Taylor expanded in t around inf 85.0%
Final simplification67.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 (or (<= z -1400000000000.0) (not (<= z 2.7e+91)))
(/ (/ (- 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 <= -1400000000000.0) || !(z <= 2.7e+91)) {
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 <= (-1400000000000.0d0)) .or. (.not. (z <= 2.7d+91))) 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 <= -1400000000000.0) || !(z <= 2.7e+91)) {
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 <= -1400000000000.0) or not (z <= 2.7e+91): 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 <= -1400000000000.0) || !(z <= 2.7e+91)) tmp = Float64(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 <= -1400000000000.0) || ~((z <= 2.7e+91)))
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, -1400000000000.0], N[Not[LessEqual[z, 2.7e+91]], $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 -1400000000000 \lor \neg \left(z \leq 2.7 \cdot 10^{+91}\right):\\
\;\;\;\;\frac{\frac{-x\_m}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.4e12 or 2.7e91 < z Initial program 78.1%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 47.1%
Taylor expanded in y around 0 41.1%
associate-*r/41.1%
neg-mul-141.1%
Simplified41.1%
distribute-frac-neg41.1%
*-commutative41.1%
associate-/r*53.5%
Applied egg-rr53.5%
if -1.4e12 < z < 2.7e91Initial program 98.2%
Taylor expanded in z around 0 65.4%
Final simplification59.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -6.8e-131)
(/ x_m (* y t))
(if (<= t 1.55e-86) (/ x_m (* z (- y))) (/ (/ x_m t) y)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -6.8e-131) {
tmp = x_m / (y * t);
} else if (t <= 1.55e-86) {
tmp = x_m / (z * -y);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-6.8d-131)) then
tmp = x_m / (y * t)
else if (t <= 1.55d-86) then
tmp = x_m / (z * -y)
else
tmp = (x_m / t) / y
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -6.8e-131) {
tmp = x_m / (y * t);
} else if (t <= 1.55e-86) {
tmp = x_m / (z * -y);
} else {
tmp = (x_m / t) / y;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -6.8e-131: tmp = x_m / (y * t) elif t <= 1.55e-86: tmp = x_m / (z * -y) else: tmp = (x_m / t) / y return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -6.8e-131) tmp = Float64(x_m / Float64(y * t)); elseif (t <= 1.55e-86) tmp = Float64(x_m / Float64(z * Float64(-y))); else tmp = Float64(Float64(x_m / t) / y); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if (t <= -6.8e-131)
tmp = x_m / (y * t);
elseif (t <= 1.55e-86)
tmp = x_m / (z * -y);
else
tmp = (x_m / t) / y;
end
tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -6.8e-131], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e-86], N[(x$95$m / N[(z * (-y)), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{-131}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-86}:\\
\;\;\;\;\frac{x\_m}{z \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\
\end{array}
\end{array}
if t < -6.7999999999999999e-131Initial program 88.1%
Taylor expanded in z around 0 57.9%
if -6.7999999999999999e-131 < t < 1.54999999999999994e-86Initial program 87.9%
Taylor expanded in x around 0 87.9%
associate-/l/97.2%
Simplified97.2%
Taylor expanded in y around inf 55.4%
Taylor expanded in t around 0 49.3%
mul-1-neg49.3%
*-commutative49.3%
Simplified49.3%
if 1.54999999999999994e-86 < t Initial program 90.2%
associate-/l/97.4%
div-inv97.4%
Applied egg-rr97.4%
*-commutative97.4%
clear-num97.3%
un-div-inv97.4%
Applied egg-rr97.4%
Taylor expanded in z around 0 50.3%
associate-/r*51.6%
Simplified51.6%
Final simplification53.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 (or (<= z -2.15e-50) (not (<= z 1e+99)))
(/ 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.15e-50) || !(z <= 1e+99)) {
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.15d-50)) .or. (.not. (z <= 1d+99))) 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.15e-50) || !(z <= 1e+99)) {
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.15e-50) or not (z <= 1e+99): 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.15e-50) || !(z <= 1e+99)) tmp = Float64(x_m / Float64(y * z)); else tmp = Float64(x_m / Float64(y * t)); end return Float64(x_s * tmp) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
tmp = 0.0;
if ((z <= -2.15e-50) || ~((z <= 1e+99)))
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.15e-50], N[Not[LessEqual[z, 1e+99]], $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.15 \cdot 10^{-50} \lor \neg \left(z \leq 10^{+99}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.14999999999999999e-50 or 9.9999999999999997e98 < z Initial program 79.4%
Taylor expanded in x around 0 79.4%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around inf 40.1%
Taylor expanded in t around 0 37.5%
mul-1-neg37.5%
associate-/r*37.6%
distribute-neg-frac237.6%
Simplified37.6%
add-sqr-sqrt19.6%
sqrt-unprod53.8%
sqr-neg53.8%
sqrt-unprod17.3%
add-sqr-sqrt35.1%
*-un-lft-identity35.1%
add-sqr-sqrt17.3%
sqrt-unprod53.8%
sqr-neg53.8%
sqrt-unprod19.6%
add-sqr-sqrt37.6%
associate-/l/37.5%
*-commutative37.5%
add-sqr-sqrt20.2%
sqrt-unprod56.4%
sqr-neg56.4%
sqrt-unprod17.3%
add-sqr-sqrt36.8%
Applied egg-rr36.8%
*-lft-identity36.8%
Simplified36.8%
if -2.14999999999999999e-50 < z < 9.9999999999999997e98Initial program 98.2%
Taylor expanded in z around 0 66.9%
Final simplification51.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -2.15e-50)
(/ x_m (* y z))
(if (<= z 7.8e+113) (/ x_m (* y t)) (/ 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 tmp;
if (z <= -2.15e-50) {
tmp = x_m / (y * z);
} else if (z <= 7.8e+113) {
tmp = x_m / (y * t);
} 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) :: tmp
if (z <= (-2.15d-50)) then
tmp = x_m / (y * z)
else if (z <= 7.8d+113) then
tmp = x_m / (y * t)
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 tmp;
if (z <= -2.15e-50) {
tmp = x_m / (y * z);
} else if (z <= 7.8e+113) {
tmp = x_m / (y * t);
} 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): tmp = 0 if z <= -2.15e-50: tmp = x_m / (y * z) elif z <= 7.8e+113: tmp = x_m / (y * t) 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) tmp = 0.0 if (z <= -2.15e-50) tmp = Float64(x_m / Float64(y * z)); elseif (z <= 7.8e+113) tmp = Float64(x_m / Float64(y * t)); else tmp = Float64(x_m / 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 (z <= -2.15e-50)
tmp = x_m / (y * z);
elseif (z <= 7.8e+113)
tmp = x_m / (y * t);
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_] := N[(x$95$s * If[LessEqual[z, -2.15e-50], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+113], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{-50}:\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+113}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z \cdot t}\\
\end{array}
\end{array}
if z < -2.14999999999999999e-50Initial program 87.1%
Taylor expanded in x around 0 87.1%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in y around inf 41.2%
Taylor expanded in t around 0 37.8%
mul-1-neg37.8%
associate-/r*36.6%
distribute-neg-frac236.6%
Simplified36.6%
add-sqr-sqrt36.6%
sqrt-unprod52.9%
sqr-neg52.9%
sqrt-unprod0.0%
add-sqr-sqrt33.2%
*-un-lft-identity33.2%
add-sqr-sqrt0.0%
sqrt-unprod52.9%
sqr-neg52.9%
sqrt-unprod36.6%
add-sqr-sqrt36.6%
associate-/l/37.8%
*-commutative37.8%
add-sqr-sqrt37.8%
sqrt-unprod53.8%
sqr-neg53.8%
sqrt-unprod0.0%
add-sqr-sqrt36.4%
Applied egg-rr36.4%
*-lft-identity36.4%
Simplified36.4%
if -2.14999999999999999e-50 < z < 7.80000000000000039e113Initial program 98.2%
Taylor expanded in z around 0 66.2%
if 7.80000000000000039e113 < z Initial program 68.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 46.9%
Taylor expanded in y around 0 41.4%
associate-*r/41.4%
neg-mul-141.4%
Simplified41.4%
add-sqr-sqrt22.1%
sqrt-unprod45.5%
sqr-neg45.5%
sqrt-unprod19.3%
add-sqr-sqrt41.5%
*-un-lft-identity41.5%
*-commutative41.5%
associate-/r*49.5%
Applied egg-rr49.5%
*-lft-identity49.5%
associate-/l/41.5%
*-commutative41.5%
Simplified41.5%
Final simplification52.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= x_m 5.2e-86)
(/ x_m (* (- y z) (- t z)))
(/ (/ 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 tmp;
if (x_m <= 5.2e-86) {
tmp = x_m / ((y - z) * (t - z));
} 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) :: tmp
if (x_m <= 5.2d-86) then
tmp = x_m / ((y - z) * (t - z))
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 tmp;
if (x_m <= 5.2e-86) {
tmp = x_m / ((y - z) * (t - z));
} 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): tmp = 0 if x_m <= 5.2e-86: tmp = x_m / ((y - z) * (t - z)) 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) tmp = 0.0 if (x_m <= 5.2e-86) tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z))); 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)
tmp = 0.0;
if (x_m <= 5.2e-86)
tmp = x_m / ((y - z) * (t - z));
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_] := N[(x$95$s * If[LessEqual[x$95$m, 5.2e-86], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 5.2 \cdot 10^{-86}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\
\end{array}
\end{array}
if x < 5.2000000000000002e-86Initial program 92.8%
if 5.2000000000000002e-86 < x Initial program 78.5%
associate-/l/99.8%
Simplified99.8%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ x_m (* y t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * (x_m / (y * t))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (x_m / (y * t));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) [x_m, y, z, t] = sort([x_m, y, z, t]) def code(x_s, x_m, y, z, t): return x_s * (x_m / (y * t))
x\_m = abs(x) x\_s = copysign(1.0, x) x_m, y, z, t = sort([x_m, y, z, t]) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(x_m / Float64(y * t))) end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp = code(x_s, x_m, y, z, t)
tmp = x_s * (x_m / (y * t));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \frac{x\_m}{y \cdot t}
\end{array}
Initial program 88.7%
Taylor expanded in z around 0 44.8%
Final simplification44.8%
(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 2024100
(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))))