
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((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 * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((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 * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (/ (* x_m 2.0) (- (* y z_m) (* z_m t)))))
(*
z_s
(*
x_s
(if (<= t_1 -5e-314)
(/ (* x_m 2.0) (* z_m (- y t)))
(if (<= t_1 4e-27)
(* (/ x_m z_m) (/ 2.0 (- y t)))
(* (/ x_m (- y t)) (/ 2.0 z_m))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = (x_m * 2.0) / ((y * z_m) - (z_m * t));
double tmp;
if (t_1 <= -5e-314) {
tmp = (x_m * 2.0) / (z_m * (y - t));
} else if (t_1 <= 4e-27) {
tmp = (x_m / z_m) * (2.0 / (y - t));
} else {
tmp = (x_m / (y - t)) * (2.0 / z_m);
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x_m * 2.0d0) / ((y * z_m) - (z_m * t))
if (t_1 <= (-5d-314)) then
tmp = (x_m * 2.0d0) / (z_m * (y - t))
else if (t_1 <= 4d-27) then
tmp = (x_m / z_m) * (2.0d0 / (y - t))
else
tmp = (x_m / (y - t)) * (2.0d0 / z_m)
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = (x_m * 2.0) / ((y * z_m) - (z_m * t));
double tmp;
if (t_1 <= -5e-314) {
tmp = (x_m * 2.0) / (z_m * (y - t));
} else if (t_1 <= 4e-27) {
tmp = (x_m / z_m) * (2.0 / (y - t));
} else {
tmp = (x_m / (y - t)) * (2.0 / z_m);
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): t_1 = (x_m * 2.0) / ((y * z_m) - (z_m * t)) tmp = 0 if t_1 <= -5e-314: tmp = (x_m * 2.0) / (z_m * (y - t)) elif t_1 <= 4e-27: tmp = (x_m / z_m) * (2.0 / (y - t)) else: tmp = (x_m / (y - t)) * (2.0 / z_m) return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) t_1 = Float64(Float64(x_m * 2.0) / Float64(Float64(y * z_m) - Float64(z_m * t))) tmp = 0.0 if (t_1 <= -5e-314) tmp = Float64(Float64(x_m * 2.0) / Float64(z_m * Float64(y - t))); elseif (t_1 <= 4e-27) tmp = Float64(Float64(x_m / z_m) * Float64(2.0 / Float64(y - t))); else tmp = Float64(Float64(x_m / Float64(y - t)) * Float64(2.0 / z_m)); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) t_1 = (x_m * 2.0) / ((y * z_m) - (z_m * t)); tmp = 0.0; if (t_1 <= -5e-314) tmp = (x_m * 2.0) / (z_m * (y - t)); elseif (t_1 <= 4e-27) tmp = (x_m / z_m) * (2.0 / (y - t)); else tmp = (x_m / (y - t)) * (2.0 / z_m); end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(N[(y * z$95$m), $MachinePrecision] - N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[t$95$1, -5e-314], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-27], N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := \frac{x\_m \cdot 2}{y \cdot z\_m - z\_m \cdot t}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-314}:\\
\;\;\;\;\frac{x\_m \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-27}:\\
\;\;\;\;\frac{x\_m}{z\_m} \cdot \frac{2}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z\_m}\\
\end{array}\right)
\end{array}
\end{array}
if (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < -4.99999999982e-314Initial program 95.9%
distribute-rgt-out--95.9%
Simplified95.9%
if -4.99999999982e-314 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < 4.0000000000000002e-27Initial program 85.3%
distribute-rgt-out--85.3%
times-frac97.5%
Simplified97.5%
if 4.0000000000000002e-27 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) Initial program 75.5%
distribute-rgt-out--89.6%
Simplified89.6%
*-commutative89.6%
times-frac96.8%
Applied egg-rr96.8%
Final simplification96.8%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (* -2.0 (/ x_m (* z_m t)))) (t_2 (* 2.0 (/ (/ x_m y) z_m))))
(*
z_s
(*
x_s
(if (<= y -5e+127)
t_2
(if (<= y -2.1e+101)
t_1
(if (<= y -4.2e-71)
t_2
(if (<= y -1.32e-104)
t_1
(if (or (<= y -1.4e-134) (not (<= y 1.3e+65)))
t_2
(* -2.0 (/ (/ x_m t) z_m)))))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = -2.0 * (x_m / (z_m * t));
double t_2 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_2;
} else if (y <= -2.1e+101) {
tmp = t_1;
} else if (y <= -4.2e-71) {
tmp = t_2;
} else if (y <= -1.32e-104) {
tmp = t_1;
} else if ((y <= -1.4e-134) || !(y <= 1.3e+65)) {
tmp = t_2;
} else {
tmp = -2.0 * ((x_m / t) / z_m);
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) * (x_m / (z_m * t))
t_2 = 2.0d0 * ((x_m / y) / z_m)
if (y <= (-5d+127)) then
tmp = t_2
else if (y <= (-2.1d+101)) then
tmp = t_1
else if (y <= (-4.2d-71)) then
tmp = t_2
else if (y <= (-1.32d-104)) then
tmp = t_1
else if ((y <= (-1.4d-134)) .or. (.not. (y <= 1.3d+65))) then
tmp = t_2
else
tmp = (-2.0d0) * ((x_m / t) / z_m)
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = -2.0 * (x_m / (z_m * t));
double t_2 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_2;
} else if (y <= -2.1e+101) {
tmp = t_1;
} else if (y <= -4.2e-71) {
tmp = t_2;
} else if (y <= -1.32e-104) {
tmp = t_1;
} else if ((y <= -1.4e-134) || !(y <= 1.3e+65)) {
tmp = t_2;
} else {
tmp = -2.0 * ((x_m / t) / z_m);
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): t_1 = -2.0 * (x_m / (z_m * t)) t_2 = 2.0 * ((x_m / y) / z_m) tmp = 0 if y <= -5e+127: tmp = t_2 elif y <= -2.1e+101: tmp = t_1 elif y <= -4.2e-71: tmp = t_2 elif y <= -1.32e-104: tmp = t_1 elif (y <= -1.4e-134) or not (y <= 1.3e+65): tmp = t_2 else: tmp = -2.0 * ((x_m / t) / z_m) return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) t_1 = Float64(-2.0 * Float64(x_m / Float64(z_m * t))) t_2 = Float64(2.0 * Float64(Float64(x_m / y) / z_m)) tmp = 0.0 if (y <= -5e+127) tmp = t_2; elseif (y <= -2.1e+101) tmp = t_1; elseif (y <= -4.2e-71) tmp = t_2; elseif (y <= -1.32e-104) tmp = t_1; elseif ((y <= -1.4e-134) || !(y <= 1.3e+65)) tmp = t_2; else tmp = Float64(-2.0 * Float64(Float64(x_m / t) / z_m)); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) t_1 = -2.0 * (x_m / (z_m * t)); t_2 = 2.0 * ((x_m / y) / z_m); tmp = 0.0; if (y <= -5e+127) tmp = t_2; elseif (y <= -2.1e+101) tmp = t_1; elseif (y <= -4.2e-71) tmp = t_2; elseif (y <= -1.32e-104) tmp = t_1; elseif ((y <= -1.4e-134) || ~((y <= 1.3e+65))) tmp = t_2; else tmp = -2.0 * ((x_m / t) / z_m); end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -5e+127], t$95$2, If[LessEqual[y, -2.1e+101], t$95$1, If[LessEqual[y, -4.2e-71], t$95$2, If[LessEqual[y, -1.32e-104], t$95$1, If[Or[LessEqual[y, -1.4e-134], N[Not[LessEqual[y, 1.3e+65]], $MachinePrecision]], t$95$2, N[(-2.0 * N[(N[(x$95$m / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]]]]]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := -2 \cdot \frac{x\_m}{z\_m \cdot t}\\
t_2 := 2 \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+127}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-71}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.32 \cdot 10^{-104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-134} \lor \neg \left(y \leq 1.3 \cdot 10^{+65}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{t}}{z\_m}\\
\end{array}\right)
\end{array}
\end{array}
if y < -5.0000000000000004e127 or -2.1e101 < y < -4.2000000000000002e-71 or -1.3199999999999999e-104 < y < -1.3999999999999999e-134 or 1.30000000000000001e65 < y Initial program 83.5%
distribute-rgt-out--88.0%
Simplified88.0%
*-commutative88.0%
times-frac93.3%
Applied egg-rr93.3%
Taylor expanded in y around inf 77.7%
associate-/r*82.2%
Simplified82.2%
if -5.0000000000000004e127 < y < -2.1e101 or -4.2000000000000002e-71 < y < -1.3199999999999999e-104Initial program 92.2%
*-commutative92.2%
associate-*l/92.1%
*-commutative92.1%
distribute-rgt-out--99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 97.4%
*-commutative97.4%
Simplified97.4%
if -1.3999999999999999e-134 < y < 1.30000000000000001e65Initial program 89.0%
*-commutative89.0%
associate-*l/87.4%
*-commutative87.4%
distribute-rgt-out--89.2%
associate-/l/89.3%
Simplified89.3%
Taylor expanded in y around 0 77.2%
associate-/r*78.4%
Simplified78.4%
Final simplification81.3%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (* 2.0 (/ (/ x_m y) z_m))))
(*
z_s
(*
x_s
(if (<= y -5e+127)
t_1
(if (<= y -3.1e+96)
(* -2.0 (/ x_m (* z_m t)))
(if (<= y -8.2e-72)
t_1
(if (<= y -1.4e-104)
(* x_m (/ -2.0 (* z_m t)))
(if (or (<= y -8.5e-135) (not (<= y 7.4e+57)))
t_1
(* -2.0 (/ (/ x_m t) z_m)))))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_1;
} else if (y <= -3.1e+96) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -8.2e-72) {
tmp = t_1;
} else if (y <= -1.4e-104) {
tmp = x_m * (-2.0 / (z_m * t));
} else if ((y <= -8.5e-135) || !(y <= 7.4e+57)) {
tmp = t_1;
} else {
tmp = -2.0 * ((x_m / t) / z_m);
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((x_m / y) / z_m)
if (y <= (-5d+127)) then
tmp = t_1
else if (y <= (-3.1d+96)) then
tmp = (-2.0d0) * (x_m / (z_m * t))
else if (y <= (-8.2d-72)) then
tmp = t_1
else if (y <= (-1.4d-104)) then
tmp = x_m * ((-2.0d0) / (z_m * t))
else if ((y <= (-8.5d-135)) .or. (.not. (y <= 7.4d+57))) then
tmp = t_1
else
tmp = (-2.0d0) * ((x_m / t) / z_m)
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_1;
} else if (y <= -3.1e+96) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -8.2e-72) {
tmp = t_1;
} else if (y <= -1.4e-104) {
tmp = x_m * (-2.0 / (z_m * t));
} else if ((y <= -8.5e-135) || !(y <= 7.4e+57)) {
tmp = t_1;
} else {
tmp = -2.0 * ((x_m / t) / z_m);
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): t_1 = 2.0 * ((x_m / y) / z_m) tmp = 0 if y <= -5e+127: tmp = t_1 elif y <= -3.1e+96: tmp = -2.0 * (x_m / (z_m * t)) elif y <= -8.2e-72: tmp = t_1 elif y <= -1.4e-104: tmp = x_m * (-2.0 / (z_m * t)) elif (y <= -8.5e-135) or not (y <= 7.4e+57): tmp = t_1 else: tmp = -2.0 * ((x_m / t) / z_m) return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) t_1 = Float64(2.0 * Float64(Float64(x_m / y) / z_m)) tmp = 0.0 if (y <= -5e+127) tmp = t_1; elseif (y <= -3.1e+96) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); elseif (y <= -8.2e-72) tmp = t_1; elseif (y <= -1.4e-104) tmp = Float64(x_m * Float64(-2.0 / Float64(z_m * t))); elseif ((y <= -8.5e-135) || !(y <= 7.4e+57)) tmp = t_1; else tmp = Float64(-2.0 * Float64(Float64(x_m / t) / z_m)); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) t_1 = 2.0 * ((x_m / y) / z_m); tmp = 0.0; if (y <= -5e+127) tmp = t_1; elseif (y <= -3.1e+96) tmp = -2.0 * (x_m / (z_m * t)); elseif (y <= -8.2e-72) tmp = t_1; elseif (y <= -1.4e-104) tmp = x_m * (-2.0 / (z_m * t)); elseif ((y <= -8.5e-135) || ~((y <= 7.4e+57))) tmp = t_1; else tmp = -2.0 * ((x_m / t) / z_m); end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -5e+127], t$95$1, If[LessEqual[y, -3.1e+96], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8.2e-72], t$95$1, If[LessEqual[y, -1.4e-104], N[(x$95$m * N[(-2.0 / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -8.5e-135], N[Not[LessEqual[y, 7.4e+57]], $MachinePrecision]], t$95$1, N[(-2.0 * N[(N[(x$95$m / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]]]]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := 2 \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.1 \cdot 10^{+96}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-104}:\\
\;\;\;\;x\_m \cdot \frac{-2}{z\_m \cdot t}\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-135} \lor \neg \left(y \leq 7.4 \cdot 10^{+57}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{t}}{z\_m}\\
\end{array}\right)
\end{array}
\end{array}
if y < -5.0000000000000004e127 or -3.0999999999999998e96 < y < -8.20000000000000007e-72 or -1.4e-104 < y < -8.49999999999999942e-135 or 7.40000000000000011e57 < y Initial program 83.5%
distribute-rgt-out--88.0%
Simplified88.0%
*-commutative88.0%
times-frac93.3%
Applied egg-rr93.3%
Taylor expanded in y around inf 77.7%
associate-/r*82.2%
Simplified82.2%
if -5.0000000000000004e127 < y < -3.0999999999999998e96Initial program 85.7%
*-commutative85.7%
associate-*l/85.7%
*-commutative85.7%
distribute-rgt-out--100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -8.20000000000000007e-72 < y < -1.4e-104Initial program 99.7%
*-commutative99.7%
associate-*l/99.5%
*-commutative99.5%
distribute-rgt-out--99.5%
associate-/l/99.5%
Simplified99.5%
Taylor expanded in y around 0 94.4%
*-commutative94.4%
Simplified94.4%
if -8.49999999999999942e-135 < y < 7.40000000000000011e57Initial program 89.0%
*-commutative89.0%
associate-*l/87.4%
*-commutative87.4%
distribute-rgt-out--89.2%
associate-/l/89.3%
Simplified89.3%
Taylor expanded in y around 0 77.2%
associate-/r*78.4%
Simplified78.4%
Final simplification81.3%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (* 2.0 (/ (/ x_m y) z_m))))
(*
z_s
(*
x_s
(if (<= y -5e+127)
t_1
(if (<= y -3.1e+96)
(* -2.0 (/ x_m (* z_m t)))
(if (<= y -3.6e-71)
t_1
(if (<= y -1.32e-104)
(* x_m (/ -2.0 (* z_m t)))
(if (<= y -1.4e-134)
(* x_m (/ (/ 2.0 y) z_m))
(if (<= y 2.05e+60) (* -2.0 (/ (/ x_m t) z_m)) t_1))))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_1;
} else if (y <= -3.1e+96) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -3.6e-71) {
tmp = t_1;
} else if (y <= -1.32e-104) {
tmp = x_m * (-2.0 / (z_m * t));
} else if (y <= -1.4e-134) {
tmp = x_m * ((2.0 / y) / z_m);
} else if (y <= 2.05e+60) {
tmp = -2.0 * ((x_m / t) / z_m);
} else {
tmp = t_1;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((x_m / y) / z_m)
if (y <= (-5d+127)) then
tmp = t_1
else if (y <= (-3.1d+96)) then
tmp = (-2.0d0) * (x_m / (z_m * t))
else if (y <= (-3.6d-71)) then
tmp = t_1
else if (y <= (-1.32d-104)) then
tmp = x_m * ((-2.0d0) / (z_m * t))
else if (y <= (-1.4d-134)) then
tmp = x_m * ((2.0d0 / y) / z_m)
else if (y <= 2.05d+60) then
tmp = (-2.0d0) * ((x_m / t) / z_m)
else
tmp = t_1
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_1;
} else if (y <= -3.1e+96) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -3.6e-71) {
tmp = t_1;
} else if (y <= -1.32e-104) {
tmp = x_m * (-2.0 / (z_m * t));
} else if (y <= -1.4e-134) {
tmp = x_m * ((2.0 / y) / z_m);
} else if (y <= 2.05e+60) {
tmp = -2.0 * ((x_m / t) / z_m);
} else {
tmp = t_1;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): t_1 = 2.0 * ((x_m / y) / z_m) tmp = 0 if y <= -5e+127: tmp = t_1 elif y <= -3.1e+96: tmp = -2.0 * (x_m / (z_m * t)) elif y <= -3.6e-71: tmp = t_1 elif y <= -1.32e-104: tmp = x_m * (-2.0 / (z_m * t)) elif y <= -1.4e-134: tmp = x_m * ((2.0 / y) / z_m) elif y <= 2.05e+60: tmp = -2.0 * ((x_m / t) / z_m) else: tmp = t_1 return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) t_1 = Float64(2.0 * Float64(Float64(x_m / y) / z_m)) tmp = 0.0 if (y <= -5e+127) tmp = t_1; elseif (y <= -3.1e+96) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); elseif (y <= -3.6e-71) tmp = t_1; elseif (y <= -1.32e-104) tmp = Float64(x_m * Float64(-2.0 / Float64(z_m * t))); elseif (y <= -1.4e-134) tmp = Float64(x_m * Float64(Float64(2.0 / y) / z_m)); elseif (y <= 2.05e+60) tmp = Float64(-2.0 * Float64(Float64(x_m / t) / z_m)); else tmp = t_1; end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) t_1 = 2.0 * ((x_m / y) / z_m); tmp = 0.0; if (y <= -5e+127) tmp = t_1; elseif (y <= -3.1e+96) tmp = -2.0 * (x_m / (z_m * t)); elseif (y <= -3.6e-71) tmp = t_1; elseif (y <= -1.32e-104) tmp = x_m * (-2.0 / (z_m * t)); elseif (y <= -1.4e-134) tmp = x_m * ((2.0 / y) / z_m); elseif (y <= 2.05e+60) tmp = -2.0 * ((x_m / t) / z_m); else tmp = t_1; end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -5e+127], t$95$1, If[LessEqual[y, -3.1e+96], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.6e-71], t$95$1, If[LessEqual[y, -1.32e-104], N[(x$95$m * N[(-2.0 / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.4e-134], N[(x$95$m * N[(N[(2.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e+60], N[(-2.0 * N[(N[(x$95$m / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := 2 \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.1 \cdot 10^{+96}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.32 \cdot 10^{-104}:\\
\;\;\;\;x\_m \cdot \frac{-2}{z\_m \cdot t}\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-134}:\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{y}}{z\_m}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+60}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{t}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}\right)
\end{array}
\end{array}
if y < -5.0000000000000004e127 or -3.0999999999999998e96 < y < -3.6e-71 or 2.05e60 < y Initial program 83.9%
distribute-rgt-out--87.2%
Simplified87.2%
*-commutative87.2%
times-frac93.6%
Applied egg-rr93.6%
Taylor expanded in y around inf 76.8%
associate-/r*82.3%
Simplified82.3%
if -5.0000000000000004e127 < y < -3.0999999999999998e96Initial program 85.7%
*-commutative85.7%
associate-*l/85.7%
*-commutative85.7%
distribute-rgt-out--100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -3.6e-71 < y < -1.3199999999999999e-104Initial program 99.7%
*-commutative99.7%
associate-*l/99.5%
*-commutative99.5%
distribute-rgt-out--99.5%
associate-/l/99.5%
Simplified99.5%
Taylor expanded in y around 0 94.4%
*-commutative94.4%
Simplified94.4%
if -1.3199999999999999e-104 < y < -1.3999999999999999e-134Initial program 77.6%
*-commutative77.6%
associate-*l/77.6%
*-commutative77.6%
distribute-rgt-out--99.7%
associate-/l/99.5%
Simplified99.5%
Taylor expanded in y around inf 90.6%
associate-/r*90.2%
Simplified90.2%
if -1.3999999999999999e-134 < y < 2.05e60Initial program 89.0%
*-commutative89.0%
associate-*l/87.4%
*-commutative87.4%
distribute-rgt-out--89.2%
associate-/l/89.3%
Simplified89.3%
Taylor expanded in y around 0 77.2%
associate-/r*78.4%
Simplified78.4%
Final simplification81.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (* 2.0 (/ (/ x_m y) z_m))))
(*
z_s
(*
x_s
(if (<= y -5e+127)
t_1
(if (<= y -2.1e+101)
(* -2.0 (/ x_m (* z_m t)))
(if (<= y -4.2e-71)
t_1
(if (<= y -1.32e-104)
(* (/ x_m t) (/ -2.0 z_m))
(if (<= y -1.4e-134)
(* x_m (/ (/ 2.0 y) z_m))
(if (<= y 6e+57) (* -2.0 (/ (/ x_m t) z_m)) t_1))))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_1;
} else if (y <= -2.1e+101) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -4.2e-71) {
tmp = t_1;
} else if (y <= -1.32e-104) {
tmp = (x_m / t) * (-2.0 / z_m);
} else if (y <= -1.4e-134) {
tmp = x_m * ((2.0 / y) / z_m);
} else if (y <= 6e+57) {
tmp = -2.0 * ((x_m / t) / z_m);
} else {
tmp = t_1;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((x_m / y) / z_m)
if (y <= (-5d+127)) then
tmp = t_1
else if (y <= (-2.1d+101)) then
tmp = (-2.0d0) * (x_m / (z_m * t))
else if (y <= (-4.2d-71)) then
tmp = t_1
else if (y <= (-1.32d-104)) then
tmp = (x_m / t) * ((-2.0d0) / z_m)
else if (y <= (-1.4d-134)) then
tmp = x_m * ((2.0d0 / y) / z_m)
else if (y <= 6d+57) then
tmp = (-2.0d0) * ((x_m / t) / z_m)
else
tmp = t_1
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_1;
} else if (y <= -2.1e+101) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -4.2e-71) {
tmp = t_1;
} else if (y <= -1.32e-104) {
tmp = (x_m / t) * (-2.0 / z_m);
} else if (y <= -1.4e-134) {
tmp = x_m * ((2.0 / y) / z_m);
} else if (y <= 6e+57) {
tmp = -2.0 * ((x_m / t) / z_m);
} else {
tmp = t_1;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): t_1 = 2.0 * ((x_m / y) / z_m) tmp = 0 if y <= -5e+127: tmp = t_1 elif y <= -2.1e+101: tmp = -2.0 * (x_m / (z_m * t)) elif y <= -4.2e-71: tmp = t_1 elif y <= -1.32e-104: tmp = (x_m / t) * (-2.0 / z_m) elif y <= -1.4e-134: tmp = x_m * ((2.0 / y) / z_m) elif y <= 6e+57: tmp = -2.0 * ((x_m / t) / z_m) else: tmp = t_1 return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) t_1 = Float64(2.0 * Float64(Float64(x_m / y) / z_m)) tmp = 0.0 if (y <= -5e+127) tmp = t_1; elseif (y <= -2.1e+101) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); elseif (y <= -4.2e-71) tmp = t_1; elseif (y <= -1.32e-104) tmp = Float64(Float64(x_m / t) * Float64(-2.0 / z_m)); elseif (y <= -1.4e-134) tmp = Float64(x_m * Float64(Float64(2.0 / y) / z_m)); elseif (y <= 6e+57) tmp = Float64(-2.0 * Float64(Float64(x_m / t) / z_m)); else tmp = t_1; end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) t_1 = 2.0 * ((x_m / y) / z_m); tmp = 0.0; if (y <= -5e+127) tmp = t_1; elseif (y <= -2.1e+101) tmp = -2.0 * (x_m / (z_m * t)); elseif (y <= -4.2e-71) tmp = t_1; elseif (y <= -1.32e-104) tmp = (x_m / t) * (-2.0 / z_m); elseif (y <= -1.4e-134) tmp = x_m * ((2.0 / y) / z_m); elseif (y <= 6e+57) tmp = -2.0 * ((x_m / t) / z_m); else tmp = t_1; end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -5e+127], t$95$1, If[LessEqual[y, -2.1e+101], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.2e-71], t$95$1, If[LessEqual[y, -1.32e-104], N[(N[(x$95$m / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.4e-134], N[(x$95$m * N[(N[(2.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+57], N[(-2.0 * N[(N[(x$95$m / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := 2 \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{+101}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.32 \cdot 10^{-104}:\\
\;\;\;\;\frac{x\_m}{t} \cdot \frac{-2}{z\_m}\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-134}:\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{y}}{z\_m}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+57}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{t}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}\right)
\end{array}
\end{array}
if y < -5.0000000000000004e127 or -2.1e101 < y < -4.2000000000000002e-71 or 5.9999999999999999e57 < y Initial program 83.9%
distribute-rgt-out--87.2%
Simplified87.2%
*-commutative87.2%
times-frac93.6%
Applied egg-rr93.6%
Taylor expanded in y around inf 76.8%
associate-/r*82.3%
Simplified82.3%
if -5.0000000000000004e127 < y < -2.1e101Initial program 85.7%
*-commutative85.7%
associate-*l/85.7%
*-commutative85.7%
distribute-rgt-out--100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.2000000000000002e-71 < y < -1.3199999999999999e-104Initial program 99.7%
distribute-rgt-out--99.7%
Simplified99.7%
*-commutative99.7%
times-frac100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 94.4%
associate-*r/94.4%
*-commutative94.4%
times-frac94.6%
Simplified94.6%
if -1.3199999999999999e-104 < y < -1.3999999999999999e-134Initial program 77.6%
*-commutative77.6%
associate-*l/77.6%
*-commutative77.6%
distribute-rgt-out--99.7%
associate-/l/99.5%
Simplified99.5%
Taylor expanded in y around inf 90.6%
associate-/r*90.2%
Simplified90.2%
if -1.3999999999999999e-134 < y < 5.9999999999999999e57Initial program 89.0%
*-commutative89.0%
associate-*l/87.4%
*-commutative87.4%
distribute-rgt-out--89.2%
associate-/l/89.3%
Simplified89.3%
Taylor expanded in y around 0 77.2%
associate-/r*78.4%
Simplified78.4%
Final simplification81.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (* (/ x_m z_m) (/ -2.0 t))) (t_2 (* 2.0 (/ (/ x_m y) z_m))))
(*
z_s
(*
x_s
(if (<= y -5e+127)
t_2
(if (<= y -5.1e+100)
(* -2.0 (/ x_m (* z_m t)))
(if (<= y -2100000000000.0)
t_2
(if (<= y -1.32e-104)
t_1
(if (<= y -1.4e-134)
(* x_m (/ (/ 2.0 y) z_m))
(if (<= y 6e+57) t_1 t_2))))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = (x_m / z_m) * (-2.0 / t);
double t_2 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_2;
} else if (y <= -5.1e+100) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -2100000000000.0) {
tmp = t_2;
} else if (y <= -1.32e-104) {
tmp = t_1;
} else if (y <= -1.4e-134) {
tmp = x_m * ((2.0 / y) / z_m);
} else if (y <= 6e+57) {
tmp = t_1;
} else {
tmp = t_2;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x_m / z_m) * ((-2.0d0) / t)
t_2 = 2.0d0 * ((x_m / y) / z_m)
if (y <= (-5d+127)) then
tmp = t_2
else if (y <= (-5.1d+100)) then
tmp = (-2.0d0) * (x_m / (z_m * t))
else if (y <= (-2100000000000.0d0)) then
tmp = t_2
else if (y <= (-1.32d-104)) then
tmp = t_1
else if (y <= (-1.4d-134)) then
tmp = x_m * ((2.0d0 / y) / z_m)
else if (y <= 6d+57) then
tmp = t_1
else
tmp = t_2
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = (x_m / z_m) * (-2.0 / t);
double t_2 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_2;
} else if (y <= -5.1e+100) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -2100000000000.0) {
tmp = t_2;
} else if (y <= -1.32e-104) {
tmp = t_1;
} else if (y <= -1.4e-134) {
tmp = x_m * ((2.0 / y) / z_m);
} else if (y <= 6e+57) {
tmp = t_1;
} else {
tmp = t_2;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): t_1 = (x_m / z_m) * (-2.0 / t) t_2 = 2.0 * ((x_m / y) / z_m) tmp = 0 if y <= -5e+127: tmp = t_2 elif y <= -5.1e+100: tmp = -2.0 * (x_m / (z_m * t)) elif y <= -2100000000000.0: tmp = t_2 elif y <= -1.32e-104: tmp = t_1 elif y <= -1.4e-134: tmp = x_m * ((2.0 / y) / z_m) elif y <= 6e+57: tmp = t_1 else: tmp = t_2 return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) t_1 = Float64(Float64(x_m / z_m) * Float64(-2.0 / t)) t_2 = Float64(2.0 * Float64(Float64(x_m / y) / z_m)) tmp = 0.0 if (y <= -5e+127) tmp = t_2; elseif (y <= -5.1e+100) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); elseif (y <= -2100000000000.0) tmp = t_2; elseif (y <= -1.32e-104) tmp = t_1; elseif (y <= -1.4e-134) tmp = Float64(x_m * Float64(Float64(2.0 / y) / z_m)); elseif (y <= 6e+57) tmp = t_1; else tmp = t_2; end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) t_1 = (x_m / z_m) * (-2.0 / t); t_2 = 2.0 * ((x_m / y) / z_m); tmp = 0.0; if (y <= -5e+127) tmp = t_2; elseif (y <= -5.1e+100) tmp = -2.0 * (x_m / (z_m * t)); elseif (y <= -2100000000000.0) tmp = t_2; elseif (y <= -1.32e-104) tmp = t_1; elseif (y <= -1.4e-134) tmp = x_m * ((2.0 / y) / z_m); elseif (y <= 6e+57) tmp = t_1; else tmp = t_2; end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -5e+127], t$95$2, If[LessEqual[y, -5.1e+100], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2100000000000.0], t$95$2, If[LessEqual[y, -1.32e-104], t$95$1, If[LessEqual[y, -1.4e-134], N[(x$95$m * N[(N[(2.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+57], t$95$1, t$95$2]]]]]]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z\_m} \cdot \frac{-2}{t}\\
t_2 := 2 \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+127}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -5.1 \cdot 10^{+100}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{elif}\;y \leq -2100000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.32 \cdot 10^{-104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-134}:\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{y}}{z\_m}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}\right)
\end{array}
\end{array}
if y < -5.0000000000000004e127 or -5.1000000000000001e100 < y < -2.1e12 or 5.9999999999999999e57 < y Initial program 83.0%
distribute-rgt-out--86.9%
Simplified86.9%
*-commutative86.9%
times-frac95.1%
Applied egg-rr95.1%
Taylor expanded in y around inf 80.3%
associate-/r*86.7%
Simplified86.7%
if -5.0000000000000004e127 < y < -5.1000000000000001e100Initial program 85.7%
*-commutative85.7%
associate-*l/85.7%
*-commutative85.7%
distribute-rgt-out--100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -2.1e12 < y < -1.3199999999999999e-104 or -1.3999999999999999e-134 < y < 5.9999999999999999e57Initial program 89.5%
distribute-rgt-out--91.1%
times-frac94.3%
Simplified94.3%
Taylor expanded in y around 0 77.1%
if -1.3199999999999999e-104 < y < -1.3999999999999999e-134Initial program 77.6%
*-commutative77.6%
associate-*l/77.6%
*-commutative77.6%
distribute-rgt-out--99.7%
associate-/l/99.5%
Simplified99.5%
Taylor expanded in y around inf 90.6%
associate-/r*90.2%
Simplified90.2%
Final simplification82.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (* (/ x_m z_m) (/ -2.0 t))) (t_2 (* 2.0 (/ (/ x_m y) z_m))))
(*
z_s
(*
x_s
(if (<= y -5e+127)
t_2
(if (<= y -5.2e+100)
(* -2.0 (/ x_m (* z_m t)))
(if (<= y -38000000000.0)
t_2
(if (<= y -4.5e-104)
t_1
(if (<= y -1.4e-134)
(/ (* x_m 2.0) (* y z_m))
(if (<= y 7.5e+57) t_1 t_2))))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = (x_m / z_m) * (-2.0 / t);
double t_2 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_2;
} else if (y <= -5.2e+100) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -38000000000.0) {
tmp = t_2;
} else if (y <= -4.5e-104) {
tmp = t_1;
} else if (y <= -1.4e-134) {
tmp = (x_m * 2.0) / (y * z_m);
} else if (y <= 7.5e+57) {
tmp = t_1;
} else {
tmp = t_2;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x_m / z_m) * ((-2.0d0) / t)
t_2 = 2.0d0 * ((x_m / y) / z_m)
if (y <= (-5d+127)) then
tmp = t_2
else if (y <= (-5.2d+100)) then
tmp = (-2.0d0) * (x_m / (z_m * t))
else if (y <= (-38000000000.0d0)) then
tmp = t_2
else if (y <= (-4.5d-104)) then
tmp = t_1
else if (y <= (-1.4d-134)) then
tmp = (x_m * 2.0d0) / (y * z_m)
else if (y <= 7.5d+57) then
tmp = t_1
else
tmp = t_2
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = (x_m / z_m) * (-2.0 / t);
double t_2 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_2;
} else if (y <= -5.2e+100) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -38000000000.0) {
tmp = t_2;
} else if (y <= -4.5e-104) {
tmp = t_1;
} else if (y <= -1.4e-134) {
tmp = (x_m * 2.0) / (y * z_m);
} else if (y <= 7.5e+57) {
tmp = t_1;
} else {
tmp = t_2;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): t_1 = (x_m / z_m) * (-2.0 / t) t_2 = 2.0 * ((x_m / y) / z_m) tmp = 0 if y <= -5e+127: tmp = t_2 elif y <= -5.2e+100: tmp = -2.0 * (x_m / (z_m * t)) elif y <= -38000000000.0: tmp = t_2 elif y <= -4.5e-104: tmp = t_1 elif y <= -1.4e-134: tmp = (x_m * 2.0) / (y * z_m) elif y <= 7.5e+57: tmp = t_1 else: tmp = t_2 return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) t_1 = Float64(Float64(x_m / z_m) * Float64(-2.0 / t)) t_2 = Float64(2.0 * Float64(Float64(x_m / y) / z_m)) tmp = 0.0 if (y <= -5e+127) tmp = t_2; elseif (y <= -5.2e+100) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); elseif (y <= -38000000000.0) tmp = t_2; elseif (y <= -4.5e-104) tmp = t_1; elseif (y <= -1.4e-134) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z_m)); elseif (y <= 7.5e+57) tmp = t_1; else tmp = t_2; end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) t_1 = (x_m / z_m) * (-2.0 / t); t_2 = 2.0 * ((x_m / y) / z_m); tmp = 0.0; if (y <= -5e+127) tmp = t_2; elseif (y <= -5.2e+100) tmp = -2.0 * (x_m / (z_m * t)); elseif (y <= -38000000000.0) tmp = t_2; elseif (y <= -4.5e-104) tmp = t_1; elseif (y <= -1.4e-134) tmp = (x_m * 2.0) / (y * z_m); elseif (y <= 7.5e+57) tmp = t_1; else tmp = t_2; end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -5e+127], t$95$2, If[LessEqual[y, -5.2e+100], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -38000000000.0], t$95$2, If[LessEqual[y, -4.5e-104], t$95$1, If[LessEqual[y, -1.4e-134], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+57], t$95$1, t$95$2]]]]]]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z\_m} \cdot \frac{-2}{t}\\
t_2 := 2 \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+127}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{+100}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{elif}\;y \leq -38000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-134}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}\right)
\end{array}
\end{array}
if y < -5.0000000000000004e127 or -5.2000000000000003e100 < y < -3.8e10 or 7.5000000000000006e57 < y Initial program 83.0%
distribute-rgt-out--86.9%
Simplified86.9%
*-commutative86.9%
times-frac95.1%
Applied egg-rr95.1%
Taylor expanded in y around inf 80.3%
associate-/r*86.7%
Simplified86.7%
if -5.0000000000000004e127 < y < -5.2000000000000003e100Initial program 85.7%
*-commutative85.7%
associate-*l/85.7%
*-commutative85.7%
distribute-rgt-out--100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -3.8e10 < y < -4.4999999999999997e-104 or -1.3999999999999999e-134 < y < 7.5000000000000006e57Initial program 89.5%
distribute-rgt-out--91.1%
times-frac94.3%
Simplified94.3%
Taylor expanded in y around 0 77.1%
if -4.4999999999999997e-104 < y < -1.3999999999999999e-134Initial program 77.6%
distribute-rgt-out--99.7%
Simplified99.7%
Taylor expanded in y around inf 90.4%
*-commutative90.4%
Simplified90.4%
Final simplification82.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (* 2.0 (/ (/ x_m y) z_m))))
(*
z_s
(*
x_s
(if (<= y -5e+127)
t_1
(if (<= y -2.1e+101)
(* -2.0 (/ x_m (* z_m t)))
(if (<= y -2700000000000.0)
t_1
(if (<= y -2.45e-104)
(* (/ x_m z_m) (/ -2.0 t))
(if (<= y -5e-135)
(/ (* x_m 2.0) (* y z_m))
(if (<= y 2.9e+58) (/ (/ (* x_m -2.0) z_m) t) t_1))))))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_1;
} else if (y <= -2.1e+101) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -2700000000000.0) {
tmp = t_1;
} else if (y <= -2.45e-104) {
tmp = (x_m / z_m) * (-2.0 / t);
} else if (y <= -5e-135) {
tmp = (x_m * 2.0) / (y * z_m);
} else if (y <= 2.9e+58) {
tmp = ((x_m * -2.0) / z_m) / t;
} else {
tmp = t_1;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((x_m / y) / z_m)
if (y <= (-5d+127)) then
tmp = t_1
else if (y <= (-2.1d+101)) then
tmp = (-2.0d0) * (x_m / (z_m * t))
else if (y <= (-2700000000000.0d0)) then
tmp = t_1
else if (y <= (-2.45d-104)) then
tmp = (x_m / z_m) * ((-2.0d0) / t)
else if (y <= (-5d-135)) then
tmp = (x_m * 2.0d0) / (y * z_m)
else if (y <= 2.9d+58) then
tmp = ((x_m * (-2.0d0)) / z_m) / t
else
tmp = t_1
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = 2.0 * ((x_m / y) / z_m);
double tmp;
if (y <= -5e+127) {
tmp = t_1;
} else if (y <= -2.1e+101) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -2700000000000.0) {
tmp = t_1;
} else if (y <= -2.45e-104) {
tmp = (x_m / z_m) * (-2.0 / t);
} else if (y <= -5e-135) {
tmp = (x_m * 2.0) / (y * z_m);
} else if (y <= 2.9e+58) {
tmp = ((x_m * -2.0) / z_m) / t;
} else {
tmp = t_1;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): t_1 = 2.0 * ((x_m / y) / z_m) tmp = 0 if y <= -5e+127: tmp = t_1 elif y <= -2.1e+101: tmp = -2.0 * (x_m / (z_m * t)) elif y <= -2700000000000.0: tmp = t_1 elif y <= -2.45e-104: tmp = (x_m / z_m) * (-2.0 / t) elif y <= -5e-135: tmp = (x_m * 2.0) / (y * z_m) elif y <= 2.9e+58: tmp = ((x_m * -2.0) / z_m) / t else: tmp = t_1 return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) t_1 = Float64(2.0 * Float64(Float64(x_m / y) / z_m)) tmp = 0.0 if (y <= -5e+127) tmp = t_1; elseif (y <= -2.1e+101) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); elseif (y <= -2700000000000.0) tmp = t_1; elseif (y <= -2.45e-104) tmp = Float64(Float64(x_m / z_m) * Float64(-2.0 / t)); elseif (y <= -5e-135) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z_m)); elseif (y <= 2.9e+58) tmp = Float64(Float64(Float64(x_m * -2.0) / z_m) / t); else tmp = t_1; end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) t_1 = 2.0 * ((x_m / y) / z_m); tmp = 0.0; if (y <= -5e+127) tmp = t_1; elseif (y <= -2.1e+101) tmp = -2.0 * (x_m / (z_m * t)); elseif (y <= -2700000000000.0) tmp = t_1; elseif (y <= -2.45e-104) tmp = (x_m / z_m) * (-2.0 / t); elseif (y <= -5e-135) tmp = (x_m * 2.0) / (y * z_m); elseif (y <= 2.9e+58) tmp = ((x_m * -2.0) / z_m) / t; else tmp = t_1; end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -5e+127], t$95$1, If[LessEqual[y, -2.1e+101], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2700000000000.0], t$95$1, If[LessEqual[y, -2.45e-104], N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5e-135], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+58], N[(N[(N[(x$95$m * -2.0), $MachinePrecision] / z$95$m), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := 2 \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{+101}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{elif}\;y \leq -2700000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.45 \cdot 10^{-104}:\\
\;\;\;\;\frac{x\_m}{z\_m} \cdot \frac{-2}{t}\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-135}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+58}:\\
\;\;\;\;\frac{\frac{x\_m \cdot -2}{z\_m}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}\right)
\end{array}
\end{array}
if y < -5.0000000000000004e127 or -2.1e101 < y < -2.7e12 or 2.90000000000000002e58 < y Initial program 83.0%
distribute-rgt-out--86.9%
Simplified86.9%
*-commutative86.9%
times-frac95.1%
Applied egg-rr95.1%
Taylor expanded in y around inf 80.3%
associate-/r*86.7%
Simplified86.7%
if -5.0000000000000004e127 < y < -2.1e101Initial program 85.7%
*-commutative85.7%
associate-*l/85.7%
*-commutative85.7%
distribute-rgt-out--100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -2.7e12 < y < -2.4500000000000001e-104Initial program 91.8%
distribute-rgt-out--91.9%
times-frac92.2%
Simplified92.2%
Taylor expanded in y around 0 66.7%
if -2.4500000000000001e-104 < y < -5.0000000000000002e-135Initial program 77.6%
distribute-rgt-out--99.7%
Simplified99.7%
Taylor expanded in y around inf 90.4%
*-commutative90.4%
Simplified90.4%
if -5.0000000000000002e-135 < y < 2.90000000000000002e58Initial program 89.0%
*-commutative89.0%
associate-*l/87.4%
*-commutative87.4%
distribute-rgt-out--89.2%
associate-/l/89.3%
Simplified89.3%
Taylor expanded in y around 0 76.0%
*-commutative76.0%
Simplified76.0%
associate-*r/77.2%
associate-/r*79.5%
Applied egg-rr79.5%
Final simplification82.3%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(*
z_s
(*
x_s
(if (<= (* x_m 2.0) 5e-61)
(* (/ x_m z_m) (/ 2.0 (- y t)))
(* (/ x_m (- y t)) (/ 2.0 z_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double tmp;
if ((x_m * 2.0) <= 5e-61) {
tmp = (x_m / z_m) * (2.0 / (y - t));
} else {
tmp = (x_m / (y - t)) * (2.0 / z_m);
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if ((x_m * 2.0d0) <= 5d-61) then
tmp = (x_m / z_m) * (2.0d0 / (y - t))
else
tmp = (x_m / (y - t)) * (2.0d0 / z_m)
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double tmp;
if ((x_m * 2.0) <= 5e-61) {
tmp = (x_m / z_m) * (2.0 / (y - t));
} else {
tmp = (x_m / (y - t)) * (2.0 / z_m);
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): tmp = 0 if (x_m * 2.0) <= 5e-61: tmp = (x_m / z_m) * (2.0 / (y - t)) else: tmp = (x_m / (y - t)) * (2.0 / z_m) return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) tmp = 0.0 if (Float64(x_m * 2.0) <= 5e-61) tmp = Float64(Float64(x_m / z_m) * Float64(2.0 / Float64(y - t))); else tmp = Float64(Float64(x_m / Float64(y - t)) * Float64(2.0 / z_m)); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) tmp = 0.0; if ((x_m * 2.0) <= 5e-61) tmp = (x_m / z_m) * (2.0 / (y - t)); else tmp = (x_m / (y - t)) * (2.0 / z_m); end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := N[(z$95$s * N[(x$95$s * If[LessEqual[N[(x$95$m * 2.0), $MachinePrecision], 5e-61], N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \cdot 2 \leq 5 \cdot 10^{-61}:\\
\;\;\;\;\frac{x\_m}{z\_m} \cdot \frac{2}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z\_m}\\
\end{array}\right)
\end{array}
if (*.f64 x 2) < 4.9999999999999999e-61Initial program 87.6%
distribute-rgt-out--89.9%
times-frac90.3%
Simplified90.3%
if 4.9999999999999999e-61 < (*.f64 x 2) Initial program 83.5%
distribute-rgt-out--89.7%
Simplified89.7%
*-commutative89.7%
times-frac96.1%
Applied egg-rr96.1%
Final simplification92.1%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (/ 2.0 (- y t))))
(*
z_s
(* x_s (if (<= z_m 5.2e+27) (* x_m (/ t_1 z_m)) (* (/ x_m z_m) t_1))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = 2.0 / (y - t);
double tmp;
if (z_m <= 5.2e+27) {
tmp = x_m * (t_1 / z_m);
} else {
tmp = (x_m / z_m) * t_1;
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 / (y - t)
if (z_m <= 5.2d+27) then
tmp = x_m * (t_1 / z_m)
else
tmp = (x_m / z_m) * t_1
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double t_1 = 2.0 / (y - t);
double tmp;
if (z_m <= 5.2e+27) {
tmp = x_m * (t_1 / z_m);
} else {
tmp = (x_m / z_m) * t_1;
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): t_1 = 2.0 / (y - t) tmp = 0 if z_m <= 5.2e+27: tmp = x_m * (t_1 / z_m) else: tmp = (x_m / z_m) * t_1 return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) t_1 = Float64(2.0 / Float64(y - t)) tmp = 0.0 if (z_m <= 5.2e+27) tmp = Float64(x_m * Float64(t_1 / z_m)); else tmp = Float64(Float64(x_m / z_m) * t_1); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) t_1 = 2.0 / (y - t); tmp = 0.0; if (z_m <= 5.2e+27) tmp = x_m * (t_1 / z_m); else tmp = (x_m / z_m) * t_1; end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 5.2e+27], N[(x$95$m * N[(t$95$1 / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z$95$m), $MachinePrecision] * t$95$1), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := \frac{2}{y - t}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 5.2 \cdot 10^{+27}:\\
\;\;\;\;x\_m \cdot \frac{t\_1}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z\_m} \cdot t\_1\\
\end{array}\right)
\end{array}
\end{array}
if z < 5.20000000000000018e27Initial program 87.0%
*-commutative87.0%
associate-*l/86.6%
*-commutative86.6%
distribute-rgt-out--90.7%
associate-/l/91.0%
Simplified91.0%
if 5.20000000000000018e27 < z Initial program 83.9%
distribute-rgt-out--85.7%
times-frac96.5%
Simplified96.5%
Final simplification92.3%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(*
z_s
(*
x_s
(if (<= z_m 9.2e-94)
(* -2.0 (/ x_m (* z_m t)))
(* -2.0 (/ (/ x_m t) z_m))))))x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double tmp;
if (z_m <= 9.2e-94) {
tmp = -2.0 * (x_m / (z_m * t));
} else {
tmp = -2.0 * ((x_m / t) / z_m);
}
return z_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (z_m <= 9.2d-94) then
tmp = (-2.0d0) * (x_m / (z_m * t))
else
tmp = (-2.0d0) * ((x_m / t) / z_m)
end if
code = z_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
double tmp;
if (z_m <= 9.2e-94) {
tmp = -2.0 * (x_m / (z_m * t));
} else {
tmp = -2.0 * ((x_m / t) / z_m);
}
return z_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): tmp = 0 if z_m <= 9.2e-94: tmp = -2.0 * (x_m / (z_m * t)) else: tmp = -2.0 * ((x_m / t) / z_m) return z_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) tmp = 0.0 if (z_m <= 9.2e-94) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); else tmp = Float64(-2.0 * Float64(Float64(x_m / t) / z_m)); end return Float64(z_s * Float64(x_s * tmp)) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x_s, x_m, y, z_m, t) tmp = 0.0; if (z_m <= 9.2e-94) tmp = -2.0 * (x_m / (z_m * t)); else tmp = -2.0 * ((x_m / t) / z_m); end tmp_2 = z_s * (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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 9.2e-94], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 9.2 \cdot 10^{-94}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{t}}{z\_m}\\
\end{array}\right)
\end{array}
if z < 9.1999999999999997e-94Initial program 85.6%
*-commutative85.6%
associate-*l/85.1%
*-commutative85.1%
distribute-rgt-out--89.7%
associate-/l/90.0%
Simplified90.0%
Taylor expanded in y around 0 50.1%
*-commutative50.1%
Simplified50.1%
if 9.1999999999999997e-94 < z Initial program 87.9%
*-commutative87.9%
associate-*l/87.8%
*-commutative87.8%
distribute-rgt-out--89.1%
associate-/l/89.1%
Simplified89.1%
Taylor expanded in y around 0 45.8%
associate-/r*49.3%
Simplified49.3%
Final simplification49.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x_s x_m y z_m t) :precision binary64 (* z_s (* x_s (* x_m (/ (/ 2.0 (- y t)) z_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
return z_s * (x_s * (x_m * ((2.0 / (y - t)) / z_m)));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
code = z_s * (x_s * (x_m * ((2.0d0 / (y - t)) / z_m)))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
return z_s * (x_s * (x_m * ((2.0 / (y - t)) / z_m)));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): return z_s * (x_s * (x_m * ((2.0 / (y - t)) / z_m)))
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) return Float64(z_s * Float64(x_s * Float64(x_m * Float64(Float64(2.0 / Float64(y - t)) / z_m)))) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp = code(z_s, x_s, x_m, y, z_m, t) tmp = z_s * (x_s * (x_m * ((2.0 / (y - t)) / z_m))); 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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := N[(z$95$s * N[(x$95$s * N[(x$95$m * N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \left(x\_s \cdot \left(x\_m \cdot \frac{\frac{2}{y - t}}{z\_m}\right)\right)
\end{array}
Initial program 86.3%
*-commutative86.3%
associate-*l/85.9%
*-commutative85.9%
distribute-rgt-out--89.5%
associate-/l/89.7%
Simplified89.7%
Final simplification89.7%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x_s x_m y z_m t) :precision binary64 (* z_s (* x_s (* -2.0 (/ x_m (* z_m t))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
return z_s * (x_s * (-2.0 * (x_m / (z_m * t))));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
code = z_s * (x_s * ((-2.0d0) * (x_m / (z_m * t))))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
return z_s * (x_s * (-2.0 * (x_m / (z_m * t))));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x_s, x_m, y, z_m, t): return z_s * (x_s * (-2.0 * (x_m / (z_m * t))))
x_m = abs(x) x_s = copysign(1.0, x) z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x_s, x_m, y, z_m, t) return Float64(z_s * Float64(x_s * Float64(-2.0 * Float64(x_m / Float64(z_m * t))))) end
x_m = abs(x); x_s = sign(x) * abs(1.0); z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp = code(z_s, x_s, x_m, y, z_m, t) tmp = z_s * (x_s * (-2.0 * (x_m / (z_m * 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]
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := N[(z$95$s * N[(x$95$s * N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \left(x\_s \cdot \left(-2 \cdot \frac{x\_m}{z\_m \cdot t}\right)\right)
\end{array}
Initial program 86.3%
*-commutative86.3%
associate-*l/85.9%
*-commutative85.9%
distribute-rgt-out--89.5%
associate-/l/89.7%
Simplified89.7%
Taylor expanded in y around 0 48.7%
*-commutative48.7%
Simplified48.7%
Final simplification48.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x (* (- y t) z)) 2.0))
(t_2 (/ (* x 2.0) (- (* y z) (* t z)))))
(if (< t_2 -2.559141628295061e-13)
t_1
(if (< t_2 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = 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) :: t_2
real(8) :: tmp
t_1 = (x / ((y - t) * z)) * 2.0d0
t_2 = (x * 2.0d0) / ((y * z) - (t * z))
if (t_2 < (-2.559141628295061d-13)) then
tmp = t_1
else if (t_2 < 1.045027827330126d-269) then
tmp = ((x / z) * 2.0d0) / (y - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / ((y - t) * z)) * 2.0 t_2 = (x * 2.0) / ((y * z) - (t * z)) tmp = 0 if t_2 < -2.559141628295061e-13: tmp = t_1 elif t_2 < 1.045027827330126e-269: tmp = ((x / z) * 2.0) / (y - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(Float64(y - t) * z)) * 2.0) t_2 = Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) tmp = 0.0 if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = Float64(Float64(Float64(x / z) * 2.0) / Float64(y - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / ((y - t) * z)) * 2.0; t_2 = (x * 2.0) / ((y * z) - (t * z)); tmp = 0.0; if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = ((x / z) * 2.0) / (y - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -2.559141628295061e-13], t$95$1, If[Less[t$95$2, 1.045027827330126e-269], N[(N[(N[(x / z), $MachinePrecision] * 2.0), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - t\right) \cdot z} \cdot 2\\
t_2 := \frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{if}\;t\_2 < -2.559141628295061 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.045027827330126 \cdot 10^{-269}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024027
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))