
(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 16 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 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (sqrt (* x_m 2.0))))
(*
z_s
(*
x_s
(if (<= (/ (* x_m 2.0) (- (* y z_m) (* z_m t))) -5e-310)
(/ (* x_m 2.0) (* z_m (- y t)))
(* (/ t_1 (- y t)) (/ t_1 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 = sqrt((x_m * 2.0));
double tmp;
if (((x_m * 2.0) / ((y * z_m) - (z_m * t))) <= -5e-310) {
tmp = (x_m * 2.0) / (z_m * (y - t));
} else {
tmp = (t_1 / (y - t)) * (t_1 / 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 = sqrt((x_m * 2.0d0))
if (((x_m * 2.0d0) / ((y * z_m) - (z_m * t))) <= (-5d-310)) then
tmp = (x_m * 2.0d0) / (z_m * (y - t))
else
tmp = (t_1 / (y - t)) * (t_1 / 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 = Math.sqrt((x_m * 2.0));
double tmp;
if (((x_m * 2.0) / ((y * z_m) - (z_m * t))) <= -5e-310) {
tmp = (x_m * 2.0) / (z_m * (y - t));
} else {
tmp = (t_1 / (y - t)) * (t_1 / 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 = math.sqrt((x_m * 2.0)) tmp = 0 if ((x_m * 2.0) / ((y * z_m) - (z_m * t))) <= -5e-310: tmp = (x_m * 2.0) / (z_m * (y - t)) else: tmp = (t_1 / (y - t)) * (t_1 / 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 = sqrt(Float64(x_m * 2.0)) tmp = 0.0 if (Float64(Float64(x_m * 2.0) / Float64(Float64(y * z_m) - Float64(z_m * t))) <= -5e-310) tmp = Float64(Float64(x_m * 2.0) / Float64(z_m * Float64(y - t))); else tmp = Float64(Float64(t_1 / Float64(y - t)) * Float64(t_1 / 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 = sqrt((x_m * 2.0)); tmp = 0.0; if (((x_m * 2.0) / ((y * z_m) - (z_m * t))) <= -5e-310) tmp = (x_m * 2.0) / (z_m * (y - t)); else tmp = (t_1 / (y - t)) * (t_1 / 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[Sqrt[N[(x$95$m * 2.0), $MachinePrecision]], $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(N[(y * z$95$m), $MachinePrecision] - N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-310], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / 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 := \sqrt{x\_m \cdot 2}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{x\_m \cdot 2}{y \cdot z\_m - z\_m \cdot t} \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{x\_m \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{y - t} \cdot \frac{t\_1}{z\_m}\\
\end{array}\right)
\end{array}
\end{array}
if (/.f64 (*.f64 x #s(literal 2 binary64)) (-.f64 (*.f64 y z) (*.f64 t z))) < -4.999999999999985e-310Initial program 98.4%
distribute-rgt-out--98.5%
Simplified98.5%
if -4.999999999999985e-310 < (/.f64 (*.f64 x #s(literal 2 binary64)) (-.f64 (*.f64 y z) (*.f64 t z))) Initial program 84.6%
distribute-rgt-out--86.5%
Simplified86.5%
add-sqr-sqrt50.5%
*-commutative50.5%
times-frac53.7%
Applied egg-rr53.7%
Final simplification68.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (/ -2.0 (* t (/ z_m x_m)))) (t_2 (* (/ x_m z_m) (/ 2.0 y))))
(*
z_s
(*
x_s
(if (<= y -5e+99)
t_2
(if (<= y -5.5e+51)
t_1
(if (<= y -1.1e-31)
(/ (* x_m 2.0) (* y z_m))
(if (<= y 3.9e-55)
(* (/ x_m t) (/ -2.0 z_m))
(if (<= y 3.8e-6)
t_2
(if (<= y 7.8e+78) t_1 (* (/ 2.0 z_m) (/ x_m y))))))))))))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 / (t * (z_m / x_m));
double t_2 = (x_m / z_m) * (2.0 / y);
double tmp;
if (y <= -5e+99) {
tmp = t_2;
} else if (y <= -5.5e+51) {
tmp = t_1;
} else if (y <= -1.1e-31) {
tmp = (x_m * 2.0) / (y * z_m);
} else if (y <= 3.9e-55) {
tmp = (x_m / t) * (-2.0 / z_m);
} else if (y <= 3.8e-6) {
tmp = t_2;
} else if (y <= 7.8e+78) {
tmp = t_1;
} else {
tmp = (2.0 / z_m) * (x_m / y);
}
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) / (t * (z_m / x_m))
t_2 = (x_m / z_m) * (2.0d0 / y)
if (y <= (-5d+99)) then
tmp = t_2
else if (y <= (-5.5d+51)) then
tmp = t_1
else if (y <= (-1.1d-31)) then
tmp = (x_m * 2.0d0) / (y * z_m)
else if (y <= 3.9d-55) then
tmp = (x_m / t) * ((-2.0d0) / z_m)
else if (y <= 3.8d-6) then
tmp = t_2
else if (y <= 7.8d+78) then
tmp = t_1
else
tmp = (2.0d0 / z_m) * (x_m / y)
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 / (t * (z_m / x_m));
double t_2 = (x_m / z_m) * (2.0 / y);
double tmp;
if (y <= -5e+99) {
tmp = t_2;
} else if (y <= -5.5e+51) {
tmp = t_1;
} else if (y <= -1.1e-31) {
tmp = (x_m * 2.0) / (y * z_m);
} else if (y <= 3.9e-55) {
tmp = (x_m / t) * (-2.0 / z_m);
} else if (y <= 3.8e-6) {
tmp = t_2;
} else if (y <= 7.8e+78) {
tmp = t_1;
} else {
tmp = (2.0 / z_m) * (x_m / y);
}
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 / (t * (z_m / x_m)) t_2 = (x_m / z_m) * (2.0 / y) tmp = 0 if y <= -5e+99: tmp = t_2 elif y <= -5.5e+51: tmp = t_1 elif y <= -1.1e-31: tmp = (x_m * 2.0) / (y * z_m) elif y <= 3.9e-55: tmp = (x_m / t) * (-2.0 / z_m) elif y <= 3.8e-6: tmp = t_2 elif y <= 7.8e+78: tmp = t_1 else: tmp = (2.0 / z_m) * (x_m / y) 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(t * Float64(z_m / x_m))) t_2 = Float64(Float64(x_m / z_m) * Float64(2.0 / y)) tmp = 0.0 if (y <= -5e+99) tmp = t_2; elseif (y <= -5.5e+51) tmp = t_1; elseif (y <= -1.1e-31) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z_m)); elseif (y <= 3.9e-55) tmp = Float64(Float64(x_m / t) * Float64(-2.0 / z_m)); elseif (y <= 3.8e-6) tmp = t_2; elseif (y <= 7.8e+78) tmp = t_1; else tmp = Float64(Float64(2.0 / z_m) * Float64(x_m / y)); 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 / (t * (z_m / x_m)); t_2 = (x_m / z_m) * (2.0 / y); tmp = 0.0; if (y <= -5e+99) tmp = t_2; elseif (y <= -5.5e+51) tmp = t_1; elseif (y <= -1.1e-31) tmp = (x_m * 2.0) / (y * z_m); elseif (y <= 3.9e-55) tmp = (x_m / t) * (-2.0 / z_m); elseif (y <= 3.8e-6) tmp = t_2; elseif (y <= 7.8e+78) tmp = t_1; else tmp = (2.0 / z_m) * (x_m / y); 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[(t * N[(z$95$m / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -5e+99], t$95$2, If[LessEqual[y, -5.5e+51], t$95$1, If[LessEqual[y, -1.1e-31], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-55], N[(N[(x$95$m / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-6], t$95$2, If[LessEqual[y, 7.8e+78], t$95$1, N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x$95$m / y), $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{-2}{t \cdot \frac{z\_m}{x\_m}}\\
t_2 := \frac{x\_m}{z\_m} \cdot \frac{2}{y}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-31}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-55}:\\
\;\;\;\;\frac{x\_m}{t} \cdot \frac{-2}{z\_m}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-6}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x\_m}{y}\\
\end{array}\right)
\end{array}
\end{array}
if y < -5.00000000000000008e99 or 3.9e-55 < y < 3.8e-6Initial program 82.0%
distribute-rgt-out--83.7%
Simplified83.7%
add-sqr-sqrt43.2%
*-commutative43.2%
times-frac47.9%
Applied egg-rr47.9%
Taylor expanded in y around inf 77.4%
associate-/r*81.7%
unpow281.7%
rem-square-sqrt82.5%
associate-/l*82.4%
associate-*l/87.8%
Simplified87.8%
if -5.00000000000000008e99 < y < -5.5e51 or 3.8e-6 < y < 7.8000000000000008e78Initial program 84.9%
distribute-rgt-out--88.8%
Simplified88.8%
Taylor expanded in y around 0 70.4%
*-commutative70.4%
Simplified70.4%
clear-num70.4%
un-div-inv70.4%
*-commutative70.4%
associate-/l*81.0%
Applied egg-rr81.0%
if -5.5e51 < y < -1.10000000000000005e-31Initial program 99.8%
distribute-rgt-out--99.8%
Simplified99.8%
Taylor expanded in y around inf 87.7%
*-commutative87.7%
Simplified87.7%
if -1.10000000000000005e-31 < y < 3.9e-55Initial program 94.1%
distribute-rgt-out--95.1%
Simplified95.1%
Taylor expanded in y around 0 80.8%
*-commutative80.8%
Simplified80.8%
clear-num79.9%
un-div-inv79.9%
*-commutative79.9%
associate-/l*80.3%
Applied egg-rr80.3%
associate-/r*80.9%
div-inv80.8%
clear-num81.0%
times-frac80.8%
*-commutative80.8%
times-frac81.4%
Applied egg-rr81.4%
if 7.8000000000000008e78 < y Initial program 85.0%
distribute-rgt-out--85.3%
Simplified85.3%
*-commutative85.3%
times-frac89.8%
Applied egg-rr89.8%
Taylor expanded in y around inf 77.6%
Final simplification82.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (/ -2.0 (* t (/ z_m x_m)))) (t_2 (* (/ x_m z_m) (/ 2.0 y))))
(*
z_s
(*
x_s
(if (<= y -2.5e+100)
t_2
(if (<= y -1.05e+52)
t_1
(if (<= y -1.95e-32)
t_2
(if (<= y 7.3e-56)
(* (/ x_m t) (/ -2.0 z_m))
(if (<= y 5.8e-8)
t_2
(if (<= y 7.8e+78) t_1 (* (/ 2.0 z_m) (/ x_m y))))))))))))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 / (t * (z_m / x_m));
double t_2 = (x_m / z_m) * (2.0 / y);
double tmp;
if (y <= -2.5e+100) {
tmp = t_2;
} else if (y <= -1.05e+52) {
tmp = t_1;
} else if (y <= -1.95e-32) {
tmp = t_2;
} else if (y <= 7.3e-56) {
tmp = (x_m / t) * (-2.0 / z_m);
} else if (y <= 5.8e-8) {
tmp = t_2;
} else if (y <= 7.8e+78) {
tmp = t_1;
} else {
tmp = (2.0 / z_m) * (x_m / y);
}
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) / (t * (z_m / x_m))
t_2 = (x_m / z_m) * (2.0d0 / y)
if (y <= (-2.5d+100)) then
tmp = t_2
else if (y <= (-1.05d+52)) then
tmp = t_1
else if (y <= (-1.95d-32)) then
tmp = t_2
else if (y <= 7.3d-56) then
tmp = (x_m / t) * ((-2.0d0) / z_m)
else if (y <= 5.8d-8) then
tmp = t_2
else if (y <= 7.8d+78) then
tmp = t_1
else
tmp = (2.0d0 / z_m) * (x_m / y)
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 / (t * (z_m / x_m));
double t_2 = (x_m / z_m) * (2.0 / y);
double tmp;
if (y <= -2.5e+100) {
tmp = t_2;
} else if (y <= -1.05e+52) {
tmp = t_1;
} else if (y <= -1.95e-32) {
tmp = t_2;
} else if (y <= 7.3e-56) {
tmp = (x_m / t) * (-2.0 / z_m);
} else if (y <= 5.8e-8) {
tmp = t_2;
} else if (y <= 7.8e+78) {
tmp = t_1;
} else {
tmp = (2.0 / z_m) * (x_m / y);
}
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 / (t * (z_m / x_m)) t_2 = (x_m / z_m) * (2.0 / y) tmp = 0 if y <= -2.5e+100: tmp = t_2 elif y <= -1.05e+52: tmp = t_1 elif y <= -1.95e-32: tmp = t_2 elif y <= 7.3e-56: tmp = (x_m / t) * (-2.0 / z_m) elif y <= 5.8e-8: tmp = t_2 elif y <= 7.8e+78: tmp = t_1 else: tmp = (2.0 / z_m) * (x_m / y) 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(t * Float64(z_m / x_m))) t_2 = Float64(Float64(x_m / z_m) * Float64(2.0 / y)) tmp = 0.0 if (y <= -2.5e+100) tmp = t_2; elseif (y <= -1.05e+52) tmp = t_1; elseif (y <= -1.95e-32) tmp = t_2; elseif (y <= 7.3e-56) tmp = Float64(Float64(x_m / t) * Float64(-2.0 / z_m)); elseif (y <= 5.8e-8) tmp = t_2; elseif (y <= 7.8e+78) tmp = t_1; else tmp = Float64(Float64(2.0 / z_m) * Float64(x_m / y)); 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 / (t * (z_m / x_m)); t_2 = (x_m / z_m) * (2.0 / y); tmp = 0.0; if (y <= -2.5e+100) tmp = t_2; elseif (y <= -1.05e+52) tmp = t_1; elseif (y <= -1.95e-32) tmp = t_2; elseif (y <= 7.3e-56) tmp = (x_m / t) * (-2.0 / z_m); elseif (y <= 5.8e-8) tmp = t_2; elseif (y <= 7.8e+78) tmp = t_1; else tmp = (2.0 / z_m) * (x_m / y); 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[(t * N[(z$95$m / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -2.5e+100], t$95$2, If[LessEqual[y, -1.05e+52], t$95$1, If[LessEqual[y, -1.95e-32], t$95$2, If[LessEqual[y, 7.3e-56], N[(N[(x$95$m / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-8], t$95$2, If[LessEqual[y, 7.8e+78], t$95$1, N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x$95$m / y), $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{-2}{t \cdot \frac{z\_m}{x\_m}}\\
t_2 := \frac{x\_m}{z\_m} \cdot \frac{2}{y}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+100}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.95 \cdot 10^{-32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 7.3 \cdot 10^{-56}:\\
\;\;\;\;\frac{x\_m}{t} \cdot \frac{-2}{z\_m}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-8}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x\_m}{y}\\
\end{array}\right)
\end{array}
\end{array}
if y < -2.4999999999999999e100 or -1.05e52 < y < -1.9500000000000001e-32 or 7.30000000000000045e-56 < y < 5.8000000000000003e-8Initial program 85.9%
distribute-rgt-out--87.2%
Simplified87.2%
add-sqr-sqrt47.3%
*-commutative47.3%
times-frac51.0%
Applied egg-rr51.0%
Taylor expanded in y around inf 79.5%
associate-/r*81.6%
unpow281.6%
rem-square-sqrt82.3%
associate-/l*82.2%
associate-*l/87.8%
Simplified87.8%
if -2.4999999999999999e100 < y < -1.05e52 or 5.8000000000000003e-8 < y < 7.8000000000000008e78Initial program 84.9%
distribute-rgt-out--88.8%
Simplified88.8%
Taylor expanded in y around 0 70.4%
*-commutative70.4%
Simplified70.4%
clear-num70.4%
un-div-inv70.4%
*-commutative70.4%
associate-/l*81.0%
Applied egg-rr81.0%
if -1.9500000000000001e-32 < y < 7.30000000000000045e-56Initial program 94.1%
distribute-rgt-out--95.1%
Simplified95.1%
Taylor expanded in y around 0 80.8%
*-commutative80.8%
Simplified80.8%
clear-num79.9%
un-div-inv79.9%
*-commutative79.9%
associate-/l*80.3%
Applied egg-rr80.3%
associate-/r*80.9%
div-inv80.8%
clear-num81.0%
times-frac80.8%
*-commutative80.8%
times-frac81.4%
Applied egg-rr81.4%
if 7.8000000000000008e78 < y Initial program 85.0%
distribute-rgt-out--85.3%
Simplified85.3%
*-commutative85.3%
times-frac89.8%
Applied egg-rr89.8%
Taylor expanded in y around inf 77.6%
Final simplification82.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (* (/ x_m t) (/ -2.0 z_m))) (t_2 (* (/ x_m z_m) (/ 2.0 y))))
(*
z_s
(*
x_s
(if (<= y -2.75e+101)
t_2
(if (<= y -9.8e+51)
(* -2.0 (/ x_m (* z_m t)))
(if (<= y -7.6e-32)
t_2
(if (<= y 3.25e-55)
t_1
(if (<= y 0.057)
t_2
(if (<= y 7.8e+78) t_1 (* (/ 2.0 z_m) (/ x_m y))))))))))))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 / t) * (-2.0 / z_m);
double t_2 = (x_m / z_m) * (2.0 / y);
double tmp;
if (y <= -2.75e+101) {
tmp = t_2;
} else if (y <= -9.8e+51) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -7.6e-32) {
tmp = t_2;
} else if (y <= 3.25e-55) {
tmp = t_1;
} else if (y <= 0.057) {
tmp = t_2;
} else if (y <= 7.8e+78) {
tmp = t_1;
} else {
tmp = (2.0 / z_m) * (x_m / y);
}
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 / t) * ((-2.0d0) / z_m)
t_2 = (x_m / z_m) * (2.0d0 / y)
if (y <= (-2.75d+101)) then
tmp = t_2
else if (y <= (-9.8d+51)) then
tmp = (-2.0d0) * (x_m / (z_m * t))
else if (y <= (-7.6d-32)) then
tmp = t_2
else if (y <= 3.25d-55) then
tmp = t_1
else if (y <= 0.057d0) then
tmp = t_2
else if (y <= 7.8d+78) then
tmp = t_1
else
tmp = (2.0d0 / z_m) * (x_m / y)
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 / t) * (-2.0 / z_m);
double t_2 = (x_m / z_m) * (2.0 / y);
double tmp;
if (y <= -2.75e+101) {
tmp = t_2;
} else if (y <= -9.8e+51) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -7.6e-32) {
tmp = t_2;
} else if (y <= 3.25e-55) {
tmp = t_1;
} else if (y <= 0.057) {
tmp = t_2;
} else if (y <= 7.8e+78) {
tmp = t_1;
} else {
tmp = (2.0 / z_m) * (x_m / y);
}
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 / t) * (-2.0 / z_m) t_2 = (x_m / z_m) * (2.0 / y) tmp = 0 if y <= -2.75e+101: tmp = t_2 elif y <= -9.8e+51: tmp = -2.0 * (x_m / (z_m * t)) elif y <= -7.6e-32: tmp = t_2 elif y <= 3.25e-55: tmp = t_1 elif y <= 0.057: tmp = t_2 elif y <= 7.8e+78: tmp = t_1 else: tmp = (2.0 / z_m) * (x_m / y) 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 / t) * Float64(-2.0 / z_m)) t_2 = Float64(Float64(x_m / z_m) * Float64(2.0 / y)) tmp = 0.0 if (y <= -2.75e+101) tmp = t_2; elseif (y <= -9.8e+51) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); elseif (y <= -7.6e-32) tmp = t_2; elseif (y <= 3.25e-55) tmp = t_1; elseif (y <= 0.057) tmp = t_2; elseif (y <= 7.8e+78) tmp = t_1; else tmp = Float64(Float64(2.0 / z_m) * Float64(x_m / y)); 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 / t) * (-2.0 / z_m); t_2 = (x_m / z_m) * (2.0 / y); tmp = 0.0; if (y <= -2.75e+101) tmp = t_2; elseif (y <= -9.8e+51) tmp = -2.0 * (x_m / (z_m * t)); elseif (y <= -7.6e-32) tmp = t_2; elseif (y <= 3.25e-55) tmp = t_1; elseif (y <= 0.057) tmp = t_2; elseif (y <= 7.8e+78) tmp = t_1; else tmp = (2.0 / z_m) * (x_m / y); 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 / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -2.75e+101], t$95$2, If[LessEqual[y, -9.8e+51], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.6e-32], t$95$2, If[LessEqual[y, 3.25e-55], t$95$1, If[LessEqual[y, 0.057], t$95$2, If[LessEqual[y, 7.8e+78], t$95$1, N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x$95$m / y), $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}{t} \cdot \frac{-2}{z\_m}\\
t_2 := \frac{x\_m}{z\_m} \cdot \frac{2}{y}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{+101}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -9.8 \cdot 10^{+51}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{elif}\;y \leq -7.6 \cdot 10^{-32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 3.25 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.057:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x\_m}{y}\\
\end{array}\right)
\end{array}
\end{array}
if y < -2.75000000000000009e101 or -9.79999999999999967e51 < y < -7.60000000000000015e-32 or 3.25000000000000003e-55 < y < 0.0570000000000000021Initial program 85.9%
distribute-rgt-out--87.2%
Simplified87.2%
add-sqr-sqrt47.3%
*-commutative47.3%
times-frac51.0%
Applied egg-rr51.0%
Taylor expanded in y around inf 79.5%
associate-/r*81.6%
unpow281.6%
rem-square-sqrt82.3%
associate-/l*82.2%
associate-*l/87.8%
Simplified87.8%
if -2.75000000000000009e101 < y < -9.79999999999999967e51Initial program 91.2%
distribute-rgt-out--91.2%
Simplified91.2%
Taylor expanded in y around 0 74.1%
*-commutative74.1%
Simplified74.1%
if -7.60000000000000015e-32 < y < 3.25000000000000003e-55 or 0.0570000000000000021 < y < 7.8000000000000008e78Initial program 92.4%
distribute-rgt-out--94.1%
Simplified94.1%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
Simplified79.2%
clear-num78.4%
un-div-inv78.4%
*-commutative78.4%
associate-/l*80.3%
Applied egg-rr80.3%
associate-/r*80.8%
div-inv80.7%
clear-num80.8%
times-frac79.2%
*-commutative79.2%
times-frac79.8%
Applied egg-rr79.8%
if 7.8000000000000008e78 < y Initial program 85.0%
distribute-rgt-out--85.3%
Simplified85.3%
*-commutative85.3%
times-frac89.8%
Applied egg-rr89.8%
Taylor expanded in y around inf 77.6%
Final simplification81.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (* (/ x_m t) (/ -2.0 z_m)))
(t_2 (* (/ 2.0 z_m) (/ x_m y)))
(t_3 (* x_m (/ 2.0 (* y z_m)))))
(*
z_s
(*
x_s
(if (<= y -4.8e+99)
t_2
(if (<= y -7.6e+57)
(* -2.0 (/ x_m (* z_m t)))
(if (<= y -1.55e-34)
t_3
(if (<= y 4.2e-55)
t_1
(if (<= y 1.25e-5) t_3 (if (<= y 7.8e+78) 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 / t) * (-2.0 / z_m);
double t_2 = (2.0 / z_m) * (x_m / y);
double t_3 = x_m * (2.0 / (y * z_m));
double tmp;
if (y <= -4.8e+99) {
tmp = t_2;
} else if (y <= -7.6e+57) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -1.55e-34) {
tmp = t_3;
} else if (y <= 4.2e-55) {
tmp = t_1;
} else if (y <= 1.25e-5) {
tmp = t_3;
} else if (y <= 7.8e+78) {
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) :: t_3
real(8) :: tmp
t_1 = (x_m / t) * ((-2.0d0) / z_m)
t_2 = (2.0d0 / z_m) * (x_m / y)
t_3 = x_m * (2.0d0 / (y * z_m))
if (y <= (-4.8d+99)) then
tmp = t_2
else if (y <= (-7.6d+57)) then
tmp = (-2.0d0) * (x_m / (z_m * t))
else if (y <= (-1.55d-34)) then
tmp = t_3
else if (y <= 4.2d-55) then
tmp = t_1
else if (y <= 1.25d-5) then
tmp = t_3
else if (y <= 7.8d+78) 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 / t) * (-2.0 / z_m);
double t_2 = (2.0 / z_m) * (x_m / y);
double t_3 = x_m * (2.0 / (y * z_m));
double tmp;
if (y <= -4.8e+99) {
tmp = t_2;
} else if (y <= -7.6e+57) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (y <= -1.55e-34) {
tmp = t_3;
} else if (y <= 4.2e-55) {
tmp = t_1;
} else if (y <= 1.25e-5) {
tmp = t_3;
} else if (y <= 7.8e+78) {
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 / t) * (-2.0 / z_m) t_2 = (2.0 / z_m) * (x_m / y) t_3 = x_m * (2.0 / (y * z_m)) tmp = 0 if y <= -4.8e+99: tmp = t_2 elif y <= -7.6e+57: tmp = -2.0 * (x_m / (z_m * t)) elif y <= -1.55e-34: tmp = t_3 elif y <= 4.2e-55: tmp = t_1 elif y <= 1.25e-5: tmp = t_3 elif y <= 7.8e+78: 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 / t) * Float64(-2.0 / z_m)) t_2 = Float64(Float64(2.0 / z_m) * Float64(x_m / y)) t_3 = Float64(x_m * Float64(2.0 / Float64(y * z_m))) tmp = 0.0 if (y <= -4.8e+99) tmp = t_2; elseif (y <= -7.6e+57) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); elseif (y <= -1.55e-34) tmp = t_3; elseif (y <= 4.2e-55) tmp = t_1; elseif (y <= 1.25e-5) tmp = t_3; elseif (y <= 7.8e+78) 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 / t) * (-2.0 / z_m); t_2 = (2.0 / z_m) * (x_m / y); t_3 = x_m * (2.0 / (y * z_m)); tmp = 0.0; if (y <= -4.8e+99) tmp = t_2; elseif (y <= -7.6e+57) tmp = -2.0 * (x_m / (z_m * t)); elseif (y <= -1.55e-34) tmp = t_3; elseif (y <= 4.2e-55) tmp = t_1; elseif (y <= 1.25e-5) tmp = t_3; elseif (y <= 7.8e+78) 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 / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x$95$m * N[(2.0 / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -4.8e+99], t$95$2, If[LessEqual[y, -7.6e+57], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.55e-34], t$95$3, If[LessEqual[y, 4.2e-55], t$95$1, If[LessEqual[y, 1.25e-5], t$95$3, If[LessEqual[y, 7.8e+78], 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}{t} \cdot \frac{-2}{z\_m}\\
t_2 := \frac{2}{z\_m} \cdot \frac{x\_m}{y}\\
t_3 := x\_m \cdot \frac{2}{y \cdot z\_m}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -7.6 \cdot 10^{+57}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-34}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-5}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}\right)
\end{array}
\end{array}
if y < -4.8000000000000002e99 or 7.8000000000000008e78 < y Initial program 82.7%
distribute-rgt-out--83.9%
Simplified83.9%
*-commutative83.9%
times-frac90.6%
Applied egg-rr90.6%
Taylor expanded in y around inf 79.5%
if -4.8000000000000002e99 < y < -7.5999999999999997e57Initial program 99.7%
distribute-rgt-out--99.7%
Simplified99.7%
Taylor expanded in y around 0 80.8%
*-commutative80.8%
Simplified80.8%
if -7.5999999999999997e57 < y < -1.5499999999999999e-34 or 4.2000000000000003e-55 < y < 1.25000000000000006e-5Initial program 92.7%
distribute-rgt-out--92.7%
Simplified92.7%
Taylor expanded in y around inf 85.1%
*-commutative85.1%
Simplified85.1%
associate-/l*85.0%
*-commutative85.0%
*-commutative85.0%
Applied egg-rr85.0%
if -1.5499999999999999e-34 < y < 4.2000000000000003e-55 or 1.25000000000000006e-5 < y < 7.8000000000000008e78Initial program 92.4%
distribute-rgt-out--94.1%
Simplified94.1%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
Simplified79.2%
clear-num78.4%
un-div-inv78.4%
*-commutative78.4%
associate-/l*80.3%
Applied egg-rr80.3%
associate-/r*80.8%
div-inv80.7%
clear-num80.8%
times-frac79.2%
*-commutative79.2%
times-frac79.8%
Applied egg-rr79.8%
Final simplification80.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(*
z_s
(*
x_s
(if (or (<= t -2.45e+85)
(and (not (<= t -2.6e-95))
(or (<= t -1.22e-126) (not (<= t 1.05e+75)))))
(* (/ x_m t) (/ -2.0 z_m))
(* x_m (/ (/ 2.0 z_m) y))))))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 ((t <= -2.45e+85) || (!(t <= -2.6e-95) && ((t <= -1.22e-126) || !(t <= 1.05e+75)))) {
tmp = (x_m / t) * (-2.0 / z_m);
} else {
tmp = x_m * ((2.0 / z_m) / y);
}
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 ((t <= (-2.45d+85)) .or. (.not. (t <= (-2.6d-95))) .and. (t <= (-1.22d-126)) .or. (.not. (t <= 1.05d+75))) then
tmp = (x_m / t) * ((-2.0d0) / z_m)
else
tmp = x_m * ((2.0d0 / z_m) / y)
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 ((t <= -2.45e+85) || (!(t <= -2.6e-95) && ((t <= -1.22e-126) || !(t <= 1.05e+75)))) {
tmp = (x_m / t) * (-2.0 / z_m);
} else {
tmp = x_m * ((2.0 / z_m) / y);
}
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 (t <= -2.45e+85) or (not (t <= -2.6e-95) and ((t <= -1.22e-126) or not (t <= 1.05e+75))): tmp = (x_m / t) * (-2.0 / z_m) else: tmp = x_m * ((2.0 / z_m) / y) 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 ((t <= -2.45e+85) || (!(t <= -2.6e-95) && ((t <= -1.22e-126) || !(t <= 1.05e+75)))) tmp = Float64(Float64(x_m / t) * Float64(-2.0 / z_m)); else tmp = Float64(x_m * Float64(Float64(2.0 / z_m) / y)); 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 ((t <= -2.45e+85) || (~((t <= -2.6e-95)) && ((t <= -1.22e-126) || ~((t <= 1.05e+75))))) tmp = (x_m / t) * (-2.0 / z_m); else tmp = x_m * ((2.0 / z_m) / y); 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[Or[LessEqual[t, -2.45e+85], And[N[Not[LessEqual[t, -2.6e-95]], $MachinePrecision], Or[LessEqual[t, -1.22e-126], N[Not[LessEqual[t, 1.05e+75]], $MachinePrecision]]]], N[(N[(x$95$m / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(2.0 / z$95$m), $MachinePrecision] / y), $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}\;t \leq -2.45 \cdot 10^{+85} \lor \neg \left(t \leq -2.6 \cdot 10^{-95}\right) \land \left(t \leq -1.22 \cdot 10^{-126} \lor \neg \left(t \leq 1.05 \cdot 10^{+75}\right)\right):\\
\;\;\;\;\frac{x\_m}{t} \cdot \frac{-2}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{z\_m}}{y}\\
\end{array}\right)
\end{array}
if t < -2.4499999999999998e85 or -2.60000000000000001e-95 < t < -1.21999999999999996e-126 or 1.04999999999999999e75 < t Initial program 85.9%
distribute-rgt-out--88.1%
Simplified88.1%
Taylor expanded in y around 0 81.2%
*-commutative81.2%
Simplified81.2%
clear-num79.8%
un-div-inv79.8%
*-commutative79.8%
associate-/l*85.3%
Applied egg-rr85.3%
associate-/r*86.7%
div-inv86.6%
clear-num86.6%
times-frac81.2%
*-commutative81.2%
times-frac84.9%
Applied egg-rr84.9%
if -2.4499999999999998e85 < t < -2.60000000000000001e-95 or -1.21999999999999996e-126 < t < 1.04999999999999999e75Initial program 91.4%
distribute-rgt-out--92.1%
Simplified92.1%
Taylor expanded in x around 0 92.1%
associate-/r*92.5%
Simplified92.5%
Taylor expanded in y around inf 70.6%
associate-*r/70.6%
*-commutative70.6%
associate-*r/70.5%
associate-/l/70.5%
Simplified70.5%
Final simplification76.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(*
z_s
(*
x_s
(if (or (<= y -4.9e+99)
(and (not (<= y -1.05e+52))
(or (<= y -1.9e-32) (not (<= y 1.5e-55)))))
(* x_m (/ (/ 2.0 z_m) y))
(* -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) {
double tmp;
if ((y <= -4.9e+99) || (!(y <= -1.05e+52) && ((y <= -1.9e-32) || !(y <= 1.5e-55)))) {
tmp = x_m * ((2.0 / z_m) / y);
} else {
tmp = -2.0 * (x_m / (z_m * t));
}
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 ((y <= (-4.9d+99)) .or. (.not. (y <= (-1.05d+52))) .and. (y <= (-1.9d-32)) .or. (.not. (y <= 1.5d-55))) then
tmp = x_m * ((2.0d0 / z_m) / y)
else
tmp = (-2.0d0) * (x_m / (z_m * t))
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 ((y <= -4.9e+99) || (!(y <= -1.05e+52) && ((y <= -1.9e-32) || !(y <= 1.5e-55)))) {
tmp = x_m * ((2.0 / z_m) / y);
} else {
tmp = -2.0 * (x_m / (z_m * t));
}
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 (y <= -4.9e+99) or (not (y <= -1.05e+52) and ((y <= -1.9e-32) or not (y <= 1.5e-55))): tmp = x_m * ((2.0 / z_m) / y) else: tmp = -2.0 * (x_m / (z_m * t)) 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 ((y <= -4.9e+99) || (!(y <= -1.05e+52) && ((y <= -1.9e-32) || !(y <= 1.5e-55)))) tmp = Float64(x_m * Float64(Float64(2.0 / z_m) / y)); else tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); 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 ((y <= -4.9e+99) || (~((y <= -1.05e+52)) && ((y <= -1.9e-32) || ~((y <= 1.5e-55))))) tmp = x_m * ((2.0 / z_m) / y); else tmp = -2.0 * (x_m / (z_m * t)); 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[Or[LessEqual[y, -4.9e+99], And[N[Not[LessEqual[y, -1.05e+52]], $MachinePrecision], Or[LessEqual[y, -1.9e-32], N[Not[LessEqual[y, 1.5e-55]], $MachinePrecision]]]], N[(x$95$m * N[(N[(2.0 / z$95$m), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+99} \lor \neg \left(y \leq -1.05 \cdot 10^{+52}\right) \land \left(y \leq -1.9 \cdot 10^{-32} \lor \neg \left(y \leq 1.5 \cdot 10^{-55}\right)\right):\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{z\_m}}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\end{array}\right)
\end{array}
if y < -4.8999999999999997e99 or -1.05e52 < y < -1.90000000000000004e-32 or 1.50000000000000008e-55 < y Initial program 84.9%
distribute-rgt-out--86.6%
Simplified86.6%
Taylor expanded in x around 0 86.5%
associate-/r*95.4%
Simplified95.4%
Taylor expanded in y around inf 72.3%
associate-*r/72.3%
*-commutative72.3%
associate-*r/72.2%
associate-/l/72.3%
Simplified72.3%
if -4.8999999999999997e99 < y < -1.05e52 or -1.90000000000000004e-32 < y < 1.50000000000000008e-55Initial program 93.8%
distribute-rgt-out--94.7%
Simplified94.7%
Taylor expanded in y around 0 80.2%
*-commutative80.2%
Simplified80.2%
Final simplification76.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (/ (/ (* x_m -2.0) z_m) t)))
(*
z_s
(*
x_s
(if (<= y -4.8e+99)
(* (/ x_m z_m) (/ 2.0 y))
(if (<= y -5.2e+51)
t_1
(if (<= y -9e-32)
(/ (* x_m 2.0) (* y z_m))
(if (<= y 7.8e+78) t_1 (* (/ 2.0 z_m) (/ x_m y))))))))))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) / z_m) / t;
double tmp;
if (y <= -4.8e+99) {
tmp = (x_m / z_m) * (2.0 / y);
} else if (y <= -5.2e+51) {
tmp = t_1;
} else if (y <= -9e-32) {
tmp = (x_m * 2.0) / (y * z_m);
} else if (y <= 7.8e+78) {
tmp = t_1;
} else {
tmp = (2.0 / z_m) * (x_m / y);
}
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)) / z_m) / t
if (y <= (-4.8d+99)) then
tmp = (x_m / z_m) * (2.0d0 / y)
else if (y <= (-5.2d+51)) then
tmp = t_1
else if (y <= (-9d-32)) then
tmp = (x_m * 2.0d0) / (y * z_m)
else if (y <= 7.8d+78) then
tmp = t_1
else
tmp = (2.0d0 / z_m) * (x_m / y)
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) / z_m) / t;
double tmp;
if (y <= -4.8e+99) {
tmp = (x_m / z_m) * (2.0 / y);
} else if (y <= -5.2e+51) {
tmp = t_1;
} else if (y <= -9e-32) {
tmp = (x_m * 2.0) / (y * z_m);
} else if (y <= 7.8e+78) {
tmp = t_1;
} else {
tmp = (2.0 / z_m) * (x_m / y);
}
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) / z_m) / t tmp = 0 if y <= -4.8e+99: tmp = (x_m / z_m) * (2.0 / y) elif y <= -5.2e+51: tmp = t_1 elif y <= -9e-32: tmp = (x_m * 2.0) / (y * z_m) elif y <= 7.8e+78: tmp = t_1 else: tmp = (2.0 / z_m) * (x_m / y) 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(Float64(x_m * -2.0) / z_m) / t) tmp = 0.0 if (y <= -4.8e+99) tmp = Float64(Float64(x_m / z_m) * Float64(2.0 / y)); elseif (y <= -5.2e+51) tmp = t_1; elseif (y <= -9e-32) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z_m)); elseif (y <= 7.8e+78) tmp = t_1; else tmp = Float64(Float64(2.0 / z_m) * Float64(x_m / y)); 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) / z_m) / t; tmp = 0.0; if (y <= -4.8e+99) tmp = (x_m / z_m) * (2.0 / y); elseif (y <= -5.2e+51) tmp = t_1; elseif (y <= -9e-32) tmp = (x_m * 2.0) / (y * z_m); elseif (y <= 7.8e+78) tmp = t_1; else tmp = (2.0 / z_m) * (x_m / y); 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[(N[(x$95$m * -2.0), $MachinePrecision] / z$95$m), $MachinePrecision] / t), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -4.8e+99], N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e+51], t$95$1, If[LessEqual[y, -9e-32], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e+78], t$95$1, N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x$95$m / y), $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{\frac{x\_m \cdot -2}{z\_m}}{t}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+99}:\\
\;\;\;\;\frac{x\_m}{z\_m} \cdot \frac{2}{y}\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-32}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x\_m}{y}\\
\end{array}\right)
\end{array}
\end{array}
if y < -4.8000000000000002e99Initial program 80.6%
distribute-rgt-out--82.6%
Simplified82.6%
add-sqr-sqrt40.8%
*-commutative40.8%
times-frac44.6%
Applied egg-rr44.6%
Taylor expanded in y around inf 75.4%
associate-/r*80.5%
unpow280.5%
rem-square-sqrt81.3%
associate-/l*81.2%
associate-*l/87.6%
Simplified87.6%
if -4.8000000000000002e99 < y < -5.2000000000000002e51 or -9.00000000000000009e-32 < y < 7.8000000000000008e78Initial program 92.2%
distribute-rgt-out--93.6%
Simplified93.6%
Taylor expanded in y around 0 74.8%
*-commutative74.8%
Simplified74.8%
*-commutative74.8%
associate-*l/74.8%
metadata-eval74.8%
distribute-rgt-neg-in74.8%
associate-/r*77.5%
distribute-rgt-neg-in77.5%
metadata-eval77.5%
Applied egg-rr77.5%
if -5.2000000000000002e51 < y < -9.00000000000000009e-32Initial program 99.8%
distribute-rgt-out--99.8%
Simplified99.8%
Taylor expanded in y around inf 87.7%
*-commutative87.7%
Simplified87.7%
if 7.8000000000000008e78 < y Initial program 85.0%
distribute-rgt-out--85.3%
Simplified85.3%
*-commutative85.3%
times-frac89.8%
Applied egg-rr89.8%
Taylor expanded in y around inf 77.6%
Final simplification80.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(let* ((t_1 (/ (/ -2.0 (/ z_m x_m)) t)))
(*
z_s
(*
x_s
(if (<= y -7.4e+99)
(* (/ x_m z_m) (/ 2.0 y))
(if (<= y -2.6e+51)
t_1
(if (<= y -2.1e-32)
(/ (* x_m 2.0) (* y z_m))
(if (<= y 6.5e+80) t_1 (* (/ 2.0 z_m) (/ x_m y))))))))))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 / (z_m / x_m)) / t;
double tmp;
if (y <= -7.4e+99) {
tmp = (x_m / z_m) * (2.0 / y);
} else if (y <= -2.6e+51) {
tmp = t_1;
} else if (y <= -2.1e-32) {
tmp = (x_m * 2.0) / (y * z_m);
} else if (y <= 6.5e+80) {
tmp = t_1;
} else {
tmp = (2.0 / z_m) * (x_m / y);
}
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) / (z_m / x_m)) / t
if (y <= (-7.4d+99)) then
tmp = (x_m / z_m) * (2.0d0 / y)
else if (y <= (-2.6d+51)) then
tmp = t_1
else if (y <= (-2.1d-32)) then
tmp = (x_m * 2.0d0) / (y * z_m)
else if (y <= 6.5d+80) then
tmp = t_1
else
tmp = (2.0d0 / z_m) * (x_m / y)
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 / (z_m / x_m)) / t;
double tmp;
if (y <= -7.4e+99) {
tmp = (x_m / z_m) * (2.0 / y);
} else if (y <= -2.6e+51) {
tmp = t_1;
} else if (y <= -2.1e-32) {
tmp = (x_m * 2.0) / (y * z_m);
} else if (y <= 6.5e+80) {
tmp = t_1;
} else {
tmp = (2.0 / z_m) * (x_m / y);
}
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 / (z_m / x_m)) / t tmp = 0 if y <= -7.4e+99: tmp = (x_m / z_m) * (2.0 / y) elif y <= -2.6e+51: tmp = t_1 elif y <= -2.1e-32: tmp = (x_m * 2.0) / (y * z_m) elif y <= 6.5e+80: tmp = t_1 else: tmp = (2.0 / z_m) * (x_m / y) 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(-2.0 / Float64(z_m / x_m)) / t) tmp = 0.0 if (y <= -7.4e+99) tmp = Float64(Float64(x_m / z_m) * Float64(2.0 / y)); elseif (y <= -2.6e+51) tmp = t_1; elseif (y <= -2.1e-32) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z_m)); elseif (y <= 6.5e+80) tmp = t_1; else tmp = Float64(Float64(2.0 / z_m) * Float64(x_m / y)); 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 / (z_m / x_m)) / t; tmp = 0.0; if (y <= -7.4e+99) tmp = (x_m / z_m) * (2.0 / y); elseif (y <= -2.6e+51) tmp = t_1; elseif (y <= -2.1e-32) tmp = (x_m * 2.0) / (y * z_m); elseif (y <= 6.5e+80) tmp = t_1; else tmp = (2.0 / z_m) * (x_m / y); 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[(-2.0 / N[(z$95$m / x$95$m), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -7.4e+99], N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.6e+51], t$95$1, If[LessEqual[y, -2.1e-32], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+80], t$95$1, N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x$95$m / y), $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{\frac{-2}{\frac{z\_m}{x\_m}}}{t}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{+99}:\\
\;\;\;\;\frac{x\_m}{z\_m} \cdot \frac{2}{y}\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-32}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x\_m}{y}\\
\end{array}\right)
\end{array}
\end{array}
if y < -7.4000000000000002e99Initial program 80.6%
distribute-rgt-out--82.6%
Simplified82.6%
add-sqr-sqrt40.8%
*-commutative40.8%
times-frac44.6%
Applied egg-rr44.6%
Taylor expanded in y around inf 75.4%
associate-/r*80.5%
unpow280.5%
rem-square-sqrt81.3%
associate-/l*81.2%
associate-*l/87.6%
Simplified87.6%
if -7.4000000000000002e99 < y < -2.6000000000000001e51 or -2.0999999999999999e-32 < y < 6.4999999999999998e80Initial program 92.2%
distribute-rgt-out--93.6%
Simplified93.6%
Taylor expanded in y around 0 74.8%
associate-*r/74.8%
*-commutative74.8%
*-commutative74.8%
associate-/l*74.4%
Simplified74.4%
*-commutative74.4%
associate-/r/74.1%
*-commutative74.1%
associate-*r/76.9%
*-commutative76.9%
associate-/r*77.4%
Applied egg-rr77.4%
if -2.6000000000000001e51 < y < -2.0999999999999999e-32Initial program 99.8%
distribute-rgt-out--99.8%
Simplified99.8%
Taylor expanded in y around inf 87.7%
*-commutative87.7%
Simplified87.7%
if 6.4999999999999998e80 < y Initial program 85.0%
distribute-rgt-out--85.3%
Simplified85.3%
*-commutative85.3%
times-frac89.8%
Applied egg-rr89.8%
Taylor expanded in y around inf 77.6%
Final simplification80.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) 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 (* x_m (/ (/ 2.0 z_m) y))))
(*
z_s
(*
x_s
(if (<= y -8.3e+99)
t_2
(if (<= y -9.2e+58)
t_1
(if (<= y -1.1e-32)
(* x_m (/ 2.0 (* y z_m)))
(if (<= y 4.2e-55) 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 = -2.0 * (x_m / (z_m * t));
double t_2 = x_m * ((2.0 / z_m) / y);
double tmp;
if (y <= -8.3e+99) {
tmp = t_2;
} else if (y <= -9.2e+58) {
tmp = t_1;
} else if (y <= -1.1e-32) {
tmp = x_m * (2.0 / (y * z_m));
} else if (y <= 4.2e-55) {
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 = (-2.0d0) * (x_m / (z_m * t))
t_2 = x_m * ((2.0d0 / z_m) / y)
if (y <= (-8.3d+99)) then
tmp = t_2
else if (y <= (-9.2d+58)) then
tmp = t_1
else if (y <= (-1.1d-32)) then
tmp = x_m * (2.0d0 / (y * z_m))
else if (y <= 4.2d-55) 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 = -2.0 * (x_m / (z_m * t));
double t_2 = x_m * ((2.0 / z_m) / y);
double tmp;
if (y <= -8.3e+99) {
tmp = t_2;
} else if (y <= -9.2e+58) {
tmp = t_1;
} else if (y <= -1.1e-32) {
tmp = x_m * (2.0 / (y * z_m));
} else if (y <= 4.2e-55) {
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 = -2.0 * (x_m / (z_m * t)) t_2 = x_m * ((2.0 / z_m) / y) tmp = 0 if y <= -8.3e+99: tmp = t_2 elif y <= -9.2e+58: tmp = t_1 elif y <= -1.1e-32: tmp = x_m * (2.0 / (y * z_m)) elif y <= 4.2e-55: 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(-2.0 * Float64(x_m / Float64(z_m * t))) t_2 = Float64(x_m * Float64(Float64(2.0 / z_m) / y)) tmp = 0.0 if (y <= -8.3e+99) tmp = t_2; elseif (y <= -9.2e+58) tmp = t_1; elseif (y <= -1.1e-32) tmp = Float64(x_m * Float64(2.0 / Float64(y * z_m))); elseif (y <= 4.2e-55) 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 = -2.0 * (x_m / (z_m * t)); t_2 = x_m * ((2.0 / z_m) / y); tmp = 0.0; if (y <= -8.3e+99) tmp = t_2; elseif (y <= -9.2e+58) tmp = t_1; elseif (y <= -1.1e-32) tmp = x_m * (2.0 / (y * z_m)); elseif (y <= 4.2e-55) 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[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x$95$m * N[(N[(2.0 / z$95$m), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -8.3e+99], t$95$2, If[LessEqual[y, -9.2e+58], t$95$1, If[LessEqual[y, -1.1e-32], N[(x$95$m * N[(2.0 / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-55], 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 := -2 \cdot \frac{x\_m}{z\_m \cdot t}\\
t_2 := x\_m \cdot \frac{\frac{2}{z\_m}}{y}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -8.3 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -9.2 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-32}:\\
\;\;\;\;x\_m \cdot \frac{2}{y \cdot z\_m}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}\right)
\end{array}
\end{array}
if y < -8.3e99 or 4.2000000000000003e-55 < y Initial program 82.9%
distribute-rgt-out--84.8%
Simplified84.8%
Taylor expanded in x around 0 84.7%
associate-/r*94.8%
Simplified94.8%
Taylor expanded in y around inf 70.3%
associate-*r/70.3%
*-commutative70.3%
associate-*r/70.2%
associate-/l/70.2%
Simplified70.2%
if -8.3e99 < y < -9.2000000000000001e58 or -1.1e-32 < y < 4.2000000000000003e-55Initial program 94.5%
distribute-rgt-out--95.5%
Simplified95.5%
Taylor expanded in y around 0 80.8%
*-commutative80.8%
Simplified80.8%
if -9.2000000000000001e58 < y < -1.1e-32Initial program 94.3%
distribute-rgt-out--94.3%
Simplified94.3%
Taylor expanded in y around inf 82.9%
*-commutative82.9%
Simplified82.9%
associate-/l*82.8%
*-commutative82.8%
*-commutative82.8%
Applied egg-rr82.8%
Final simplification76.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(*
z_s
(*
x_s
(if (<= (* x_m 2.0) 5e-88)
(/ (* x_m 2.0) (* z_m (- y t)))
(/ (/ (* 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) {
double tmp;
if ((x_m * 2.0) <= 5e-88) {
tmp = (x_m * 2.0) / (z_m * (y - t));
} else {
tmp = ((x_m * 2.0) / (y - 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 ((x_m * 2.0d0) <= 5d-88) then
tmp = (x_m * 2.0d0) / (z_m * (y - t))
else
tmp = ((x_m * 2.0d0) / (y - 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 ((x_m * 2.0) <= 5e-88) {
tmp = (x_m * 2.0) / (z_m * (y - t));
} else {
tmp = ((x_m * 2.0) / (y - 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 (x_m * 2.0) <= 5e-88: tmp = (x_m * 2.0) / (z_m * (y - t)) else: tmp = ((x_m * 2.0) / (y - 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 (Float64(x_m * 2.0) <= 5e-88) tmp = Float64(Float64(x_m * 2.0) / Float64(z_m * Float64(y - t))); else tmp = Float64(Float64(Float64(x_m * 2.0) / Float64(y - 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 ((x_m * 2.0) <= 5e-88) tmp = (x_m * 2.0) / (z_m * (y - t)); else tmp = ((x_m * 2.0) / (y - 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[N[(x$95$m * 2.0), $MachinePrecision], 5e-88], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision] / z$95$m), $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^{-88}:\\
\;\;\;\;\frac{x\_m \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m \cdot 2}{y - t}}{z\_m}\\
\end{array}\right)
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 5.00000000000000009e-88Initial program 88.6%
distribute-rgt-out--89.8%
Simplified89.8%
if 5.00000000000000009e-88 < (*.f64 x #s(literal 2 binary64)) Initial program 90.1%
distribute-rgt-out--91.5%
Simplified91.5%
add-sqr-sqrt91.2%
*-commutative91.2%
times-frac95.0%
Applied egg-rr95.0%
associate-*r/98.3%
associate-*l/98.4%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(*
z_s
(*
x_s
(if (<= (* x_m 2.0) 5e-88)
(/ (* x_m 2.0) (* z_m (- 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-88) {
tmp = (x_m * 2.0) / (z_m * (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-88) then
tmp = (x_m * 2.0d0) / (z_m * (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-88) {
tmp = (x_m * 2.0) / (z_m * (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-88: tmp = (x_m * 2.0) / (z_m * (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-88) tmp = Float64(Float64(x_m * 2.0) / Float64(z_m * 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-88) tmp = (x_m * 2.0) / (z_m * (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-88], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(z$95$m * 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^{-88}:\\
\;\;\;\;\frac{x\_m \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z\_m}\\
\end{array}\right)
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 5.00000000000000009e-88Initial program 88.6%
distribute-rgt-out--89.8%
Simplified89.8%
if 5.00000000000000009e-88 < (*.f64 x #s(literal 2 binary64)) Initial program 90.1%
distribute-rgt-out--91.5%
Simplified91.5%
*-commutative91.5%
times-frac98.6%
Applied egg-rr98.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(*
z_s
(*
x_s
(if (<= (* x_m 2.0) 1e-69)
(* x_m (/ (/ 2.0 z_m) (- 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) <= 1e-69) {
tmp = x_m * ((2.0 / z_m) / (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) <= 1d-69) then
tmp = x_m * ((2.0d0 / z_m) / (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) <= 1e-69) {
tmp = x_m * ((2.0 / z_m) / (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) <= 1e-69: tmp = x_m * ((2.0 / z_m) / (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) <= 1e-69) tmp = Float64(x_m * Float64(Float64(2.0 / z_m) / 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) <= 1e-69) tmp = x_m * ((2.0 / z_m) / (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], 1e-69], N[(x$95$m * N[(N[(2.0 / z$95$m), $MachinePrecision] / 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 10^{-69}:\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{z\_m}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z\_m}\\
\end{array}\right)
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 9.9999999999999996e-70Initial program 88.9%
distribute-rgt-out--90.1%
Simplified90.1%
add-sqr-sqrt32.9%
*-commutative32.9%
times-frac30.2%
Applied egg-rr30.2%
Taylor expanded in x around 0 89.3%
associate-/l*89.3%
unpow289.3%
rem-square-sqrt90.0%
*-commutative90.0%
associate-/l/90.4%
Simplified90.4%
if 9.9999999999999996e-70 < (*.f64 x #s(literal 2 binary64)) Initial program 89.6%
distribute-rgt-out--91.0%
Simplified91.0%
*-commutative91.0%
times-frac98.5%
Applied egg-rr98.5%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m t)
:precision binary64
(*
z_s
(*
x_s
(if (<= z_m 1.5e+52)
(* x_m (/ (/ 2.0 z_m) (- y t)))
(* 2.0 (/ (/ x_m z_m) (- y 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) {
double tmp;
if (z_m <= 1.5e+52) {
tmp = x_m * ((2.0 / z_m) / (y - t));
} else {
tmp = 2.0 * ((x_m / z_m) / (y - t));
}
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 <= 1.5d+52) then
tmp = x_m * ((2.0d0 / z_m) / (y - t))
else
tmp = 2.0d0 * ((x_m / z_m) / (y - t))
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 <= 1.5e+52) {
tmp = x_m * ((2.0 / z_m) / (y - t));
} else {
tmp = 2.0 * ((x_m / z_m) / (y - t));
}
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 <= 1.5e+52: tmp = x_m * ((2.0 / z_m) / (y - t)) else: tmp = 2.0 * ((x_m / z_m) / (y - t)) 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 <= 1.5e+52) tmp = Float64(x_m * Float64(Float64(2.0 / z_m) / Float64(y - t))); else tmp = Float64(2.0 * Float64(Float64(x_m / z_m) / Float64(y - t))); 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 <= 1.5e+52) tmp = x_m * ((2.0 / z_m) / (y - t)); else tmp = 2.0 * ((x_m / z_m) / (y - t)); 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, 1.5e+52], N[(x$95$m * N[(N[(2.0 / z$95$m), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x$95$m / z$95$m), $MachinePrecision] / N[(y - 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 \begin{array}{l}
\mathbf{if}\;z\_m \leq 1.5 \cdot 10^{+52}:\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{z\_m}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x\_m}{z\_m}}{y - t}\\
\end{array}\right)
\end{array}
if z < 1.5e52Initial program 91.6%
distribute-rgt-out--92.2%
Simplified92.2%
add-sqr-sqrt56.0%
*-commutative56.0%
times-frac55.7%
Applied egg-rr55.7%
Taylor expanded in x around 0 91.3%
associate-/l*91.1%
unpow291.1%
rem-square-sqrt91.9%
*-commutative91.9%
associate-/l/92.2%
Simplified92.2%
if 1.5e52 < z Initial program 79.7%
distribute-rgt-out--83.6%
Simplified83.6%
Taylor expanded in x around 0 83.6%
associate-/r*94.9%
Simplified94.9%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) z) (FPCore (z_s x_s x_m y z_m t) :precision binary64 (* z_s (* x_s (* 2.0 (/ (/ x_m z_m) (- y 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) / (y - 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) / (y - 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) / (y - 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) / (y - 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(Float64(x_m / z_m) / Float64(y - 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) / (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]
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[(N[(x$95$m / z$95$m), $MachinePrecision] / N[(y - 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{\frac{x\_m}{z\_m}}{y - t}\right)\right)
\end{array}
Initial program 89.2%
distribute-rgt-out--90.4%
Simplified90.4%
Taylor expanded in x around 0 90.4%
associate-/r*93.9%
Simplified93.9%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) 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 89.2%
distribute-rgt-out--90.4%
Simplified90.4%
Taylor expanded in y around 0 55.0%
*-commutative55.0%
Simplified55.0%
(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 2024096
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:alt
(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))))