
(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 14 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 (/ (* x_m 2.0) (- (* y z_m) (* z_m t)))))
(*
z_s
(*
x_s
(if (<= t_1 -5e-316)
t_1
(if (<= t_1 1e-167)
(/ (* -2.0 (/ x_m z_m)) (- t y))
(* (/ 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-316) {
tmp = t_1;
} else if (t_1 <= 1e-167) {
tmp = (-2.0 * (x_m / z_m)) / (t - y);
} 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-316)) then
tmp = t_1
else if (t_1 <= 1d-167) then
tmp = ((-2.0d0) * (x_m / z_m)) / (t - y)
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-316) {
tmp = t_1;
} else if (t_1 <= 1e-167) {
tmp = (-2.0 * (x_m / z_m)) / (t - y);
} 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-316: tmp = t_1 elif t_1 <= 1e-167: tmp = (-2.0 * (x_m / z_m)) / (t - y) 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-316) tmp = t_1; elseif (t_1 <= 1e-167) tmp = Float64(Float64(-2.0 * Float64(x_m / z_m)) / Float64(t - y)); 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-316) tmp = t_1; elseif (t_1 <= 1e-167) tmp = (-2.0 * (x_m / z_m)) / (t - y); 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-316], t$95$1, If[LessEqual[t$95$1, 1e-167], N[(N[(-2.0 * N[(x$95$m / z$95$m), $MachinePrecision]), $MachinePrecision] / N[(t - y), $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^{-316}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{-167}:\\
\;\;\;\;\frac{-2 \cdot \frac{x\_m}{z\_m}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z\_m}\\
\end{array}\right)
\end{array}
\end{array}
if (/.f64 (*.f64 x #s(literal 2 binary64)) (-.f64 (*.f64 y z) (*.f64 t z))) < -5.000000017e-316Initial program 92.0%
if -5.000000017e-316 < (/.f64 (*.f64 x #s(literal 2 binary64)) (-.f64 (*.f64 y z) (*.f64 t z))) < 1e-167Initial program 85.7%
distribute-rgt-out--85.7%
Simplified85.7%
Taylor expanded in x around 0 85.6%
associate-*r/85.7%
metadata-eval85.7%
distribute-lft-neg-in85.7%
*-commutative85.7%
distribute-neg-frac85.7%
associate-/r*98.9%
*-commutative98.9%
associate-*r/98.9%
distribute-neg-frac298.9%
neg-sub098.9%
sub-neg98.9%
+-commutative98.9%
associate--r+98.9%
neg-sub098.9%
remove-double-neg98.9%
Simplified98.9%
if 1e-167 < (/.f64 (*.f64 x #s(literal 2 binary64)) (-.f64 (*.f64 y z) (*.f64 t z))) Initial program 92.7%
distribute-rgt-out--97.7%
Simplified97.7%
*-commutative97.7%
times-frac91.3%
Applied egg-rr91.3%
Final simplification94.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 (or (<= y -80000000000000.0) (not (<= y 11600.0)))
(* x_m (/ (/ 2.0 z_m) (+ y t)))
(/ (/ (* x_m -2.0) 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 ((y <= -80000000000000.0) || !(y <= 11600.0)) {
tmp = x_m * ((2.0 / z_m) / (y + t));
} else {
tmp = ((x_m * -2.0) / 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 ((y <= (-80000000000000.0d0)) .or. (.not. (y <= 11600.0d0))) then
tmp = x_m * ((2.0d0 / z_m) / (y + t))
else
tmp = ((x_m * (-2.0d0)) / 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 ((y <= -80000000000000.0) || !(y <= 11600.0)) {
tmp = x_m * ((2.0 / z_m) / (y + t));
} else {
tmp = ((x_m * -2.0) / 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 (y <= -80000000000000.0) or not (y <= 11600.0): tmp = x_m * ((2.0 / z_m) / (y + t)) else: tmp = ((x_m * -2.0) / 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 ((y <= -80000000000000.0) || !(y <= 11600.0)) tmp = Float64(x_m * Float64(Float64(2.0 / z_m) / Float64(y + t))); else tmp = Float64(Float64(Float64(x_m * -2.0) / 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 ((y <= -80000000000000.0) || ~((y <= 11600.0))) tmp = x_m * ((2.0 / z_m) / (y + t)); else tmp = ((x_m * -2.0) / 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[Or[LessEqual[y, -80000000000000.0], N[Not[LessEqual[y, 11600.0]], $MachinePrecision]], N[(x$95$m * N[(N[(2.0 / z$95$m), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$95$m * -2.0), $MachinePrecision] / t), $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}\;y \leq -80000000000000 \lor \neg \left(y \leq 11600\right):\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{z\_m}}{y + t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m \cdot -2}{t}}{z\_m}\\
\end{array}\right)
\end{array}
if y < -8e13 or 11600 < y Initial program 90.2%
distribute-rgt-out--92.5%
Simplified92.5%
clear-num91.6%
distribute-rgt-out--89.2%
inv-pow89.2%
distribute-rgt-out--91.6%
*-commutative91.6%
associate-/l*91.4%
Applied egg-rr91.4%
unpow-191.4%
*-commutative91.4%
associate-*l/91.6%
clear-num92.5%
frac-times91.0%
associate-*l/88.8%
associate-/l*92.7%
sub-neg92.7%
add-sqr-sqrt51.8%
sqrt-unprod79.4%
sqr-neg79.4%
sqrt-unprod35.6%
add-sqr-sqrt81.0%
Applied egg-rr81.0%
associate-/r*81.0%
associate-/l/80.9%
+-commutative80.9%
Simplified80.9%
if -8e13 < y < 11600Initial program 89.4%
distribute-rgt-out--91.0%
Simplified91.0%
Taylor expanded in y around 0 76.4%
*-commutative76.4%
Simplified76.4%
*-commutative76.4%
associate-*l/76.4%
metadata-eval76.4%
distribute-rgt-neg-in76.4%
*-commutative76.4%
associate-/r*79.1%
distribute-rgt-neg-in79.1%
metadata-eval79.1%
Applied egg-rr79.1%
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
(*
z_s
(*
x_s
(if (<= t -3.3e+59)
(/ (/ (* x_m -2.0) t) z_m)
(if (<= t 1.6e-7)
(/ (* x_m 2.0) (* y z_m))
(/ (/ (* x_m -2.0) 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 (t <= -3.3e+59) {
tmp = ((x_m * -2.0) / t) / z_m;
} else if (t <= 1.6e-7) {
tmp = (x_m * 2.0) / (y * z_m);
} else {
tmp = ((x_m * -2.0) / 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 (t <= (-3.3d+59)) then
tmp = ((x_m * (-2.0d0)) / t) / z_m
else if (t <= 1.6d-7) then
tmp = (x_m * 2.0d0) / (y * z_m)
else
tmp = ((x_m * (-2.0d0)) / 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 (t <= -3.3e+59) {
tmp = ((x_m * -2.0) / t) / z_m;
} else if (t <= 1.6e-7) {
tmp = (x_m * 2.0) / (y * z_m);
} else {
tmp = ((x_m * -2.0) / 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 t <= -3.3e+59: tmp = ((x_m * -2.0) / t) / z_m elif t <= 1.6e-7: tmp = (x_m * 2.0) / (y * z_m) else: tmp = ((x_m * -2.0) / 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 (t <= -3.3e+59) tmp = Float64(Float64(Float64(x_m * -2.0) / t) / z_m); elseif (t <= 1.6e-7) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z_m)); else tmp = Float64(Float64(Float64(x_m * -2.0) / 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 (t <= -3.3e+59) tmp = ((x_m * -2.0) / t) / z_m; elseif (t <= 1.6e-7) tmp = (x_m * 2.0) / (y * z_m); else tmp = ((x_m * -2.0) / 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[LessEqual[t, -3.3e+59], N[(N[(N[(x$95$m * -2.0), $MachinePrecision] / t), $MachinePrecision] / z$95$m), $MachinePrecision], If[LessEqual[t, 1.6e-7], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$95$m * -2.0), $MachinePrecision] / z$95$m), $MachinePrecision] / t), $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 -3.3 \cdot 10^{+59}:\\
\;\;\;\;\frac{\frac{x\_m \cdot -2}{t}}{z\_m}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-7}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m \cdot -2}{z\_m}}{t}\\
\end{array}\right)
\end{array}
if t < -3.2999999999999999e59Initial program 88.3%
distribute-rgt-out--90.1%
Simplified90.1%
Taylor expanded in y around 0 76.6%
*-commutative76.6%
Simplified76.6%
*-commutative76.6%
associate-*l/76.7%
metadata-eval76.7%
distribute-rgt-neg-in76.7%
*-commutative76.7%
associate-/r*78.3%
distribute-rgt-neg-in78.3%
metadata-eval78.3%
Applied egg-rr78.3%
if -3.2999999999999999e59 < t < 1.6e-7Initial program 91.7%
distribute-rgt-out--94.0%
Simplified94.0%
Taylor expanded in y around inf 78.1%
*-commutative78.1%
Simplified78.1%
if 1.6e-7 < t Initial program 87.4%
distribute-rgt-out--88.9%
Simplified88.9%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
Simplified79.2%
*-commutative79.2%
associate-*l/79.2%
metadata-eval79.2%
distribute-rgt-neg-in79.2%
associate-/r*83.5%
distribute-rgt-neg-in83.5%
metadata-eval83.5%
Applied egg-rr83.5%
Final simplification79.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 (<= t -3.3e+54)
(/ (/ (* x_m -2.0) t) z_m)
(if (<= t 1.95e-5)
(/ (* x_m 2.0) (* y z_m))
(* -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 (t <= -3.3e+54) {
tmp = ((x_m * -2.0) / t) / z_m;
} else if (t <= 1.95e-5) {
tmp = (x_m * 2.0) / (y * z_m);
} 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 (t <= (-3.3d+54)) then
tmp = ((x_m * (-2.0d0)) / t) / z_m
else if (t <= 1.95d-5) then
tmp = (x_m * 2.0d0) / (y * z_m)
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 (t <= -3.3e+54) {
tmp = ((x_m * -2.0) / t) / z_m;
} else if (t <= 1.95e-5) {
tmp = (x_m * 2.0) / (y * z_m);
} 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 t <= -3.3e+54: tmp = ((x_m * -2.0) / t) / z_m elif t <= 1.95e-5: tmp = (x_m * 2.0) / (y * z_m) 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 (t <= -3.3e+54) tmp = Float64(Float64(Float64(x_m * -2.0) / t) / z_m); elseif (t <= 1.95e-5) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z_m)); else tmp = Float64(-2.0 * Float64(Float64(x_m / 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 (t <= -3.3e+54) tmp = ((x_m * -2.0) / t) / z_m; elseif (t <= 1.95e-5) tmp = (x_m * 2.0) / (y * z_m); 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[LessEqual[t, -3.3e+54], N[(N[(N[(x$95$m * -2.0), $MachinePrecision] / t), $MachinePrecision] / z$95$m), $MachinePrecision], If[LessEqual[t, 1.95e-5], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z$95$m), $MachinePrecision] / t), $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 -3.3 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{x\_m \cdot -2}{t}}{z\_m}\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-5}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z\_m}}{t}\\
\end{array}\right)
\end{array}
if t < -3.3e54Initial program 88.3%
distribute-rgt-out--90.1%
Simplified90.1%
Taylor expanded in y around 0 76.6%
*-commutative76.6%
Simplified76.6%
*-commutative76.6%
associate-*l/76.7%
metadata-eval76.7%
distribute-rgt-neg-in76.7%
*-commutative76.7%
associate-/r*78.3%
distribute-rgt-neg-in78.3%
metadata-eval78.3%
Applied egg-rr78.3%
if -3.3e54 < t < 1.95e-5Initial program 91.7%
distribute-rgt-out--94.0%
Simplified94.0%
Taylor expanded in y around inf 78.1%
*-commutative78.1%
Simplified78.1%
if 1.95e-5 < t Initial program 87.4%
distribute-rgt-out--88.9%
Simplified88.9%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
associate-/r*83.5%
Simplified83.5%
Final simplification79.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 (<= t -4.2e+57)
(* (/ -2.0 z_m) (/ x_m t))
(if (<= t 7.5e-6)
(/ (* x_m 2.0) (* y z_m))
(* -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 (t <= -4.2e+57) {
tmp = (-2.0 / z_m) * (x_m / t);
} else if (t <= 7.5e-6) {
tmp = (x_m * 2.0) / (y * z_m);
} 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 (t <= (-4.2d+57)) then
tmp = ((-2.0d0) / z_m) * (x_m / t)
else if (t <= 7.5d-6) then
tmp = (x_m * 2.0d0) / (y * z_m)
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 (t <= -4.2e+57) {
tmp = (-2.0 / z_m) * (x_m / t);
} else if (t <= 7.5e-6) {
tmp = (x_m * 2.0) / (y * z_m);
} 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 t <= -4.2e+57: tmp = (-2.0 / z_m) * (x_m / t) elif t <= 7.5e-6: tmp = (x_m * 2.0) / (y * z_m) 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 (t <= -4.2e+57) tmp = Float64(Float64(-2.0 / z_m) * Float64(x_m / t)); elseif (t <= 7.5e-6) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z_m)); else tmp = Float64(-2.0 * Float64(Float64(x_m / 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 (t <= -4.2e+57) tmp = (-2.0 / z_m) * (x_m / t); elseif (t <= 7.5e-6) tmp = (x_m * 2.0) / (y * z_m); 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[LessEqual[t, -4.2e+57], N[(N[(-2.0 / z$95$m), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e-6], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z$95$m), $MachinePrecision] / t), $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 -4.2 \cdot 10^{+57}:\\
\;\;\;\;\frac{-2}{z\_m} \cdot \frac{x\_m}{t}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z\_m}}{t}\\
\end{array}\right)
\end{array}
if t < -4.19999999999999982e57Initial program 88.3%
distribute-rgt-out--90.1%
Simplified90.1%
Taylor expanded in y around 0 76.7%
associate-*r*76.7%
neg-mul-176.7%
*-commutative76.7%
Simplified76.7%
frac-2neg76.7%
*-commutative76.7%
distribute-lft-neg-in76.7%
metadata-eval76.7%
distribute-rgt-neg-out76.7%
remove-double-neg76.7%
times-frac78.2%
Applied egg-rr78.2%
if -4.19999999999999982e57 < t < 7.50000000000000019e-6Initial program 91.7%
distribute-rgt-out--94.0%
Simplified94.0%
Taylor expanded in y around inf 78.1%
*-commutative78.1%
Simplified78.1%
if 7.50000000000000019e-6 < t Initial program 87.4%
distribute-rgt-out--88.9%
Simplified88.9%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
associate-/r*83.5%
Simplified83.5%
Final simplification79.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 (<= t -7.5e+54)
(* (/ -2.0 z_m) (/ x_m t))
(if (<= t 1.15e-8)
(* x_m (/ 2.0 (* y z_m)))
(* -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 (t <= -7.5e+54) {
tmp = (-2.0 / z_m) * (x_m / t);
} else if (t <= 1.15e-8) {
tmp = x_m * (2.0 / (y * z_m));
} 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 (t <= (-7.5d+54)) then
tmp = ((-2.0d0) / z_m) * (x_m / t)
else if (t <= 1.15d-8) then
tmp = x_m * (2.0d0 / (y * z_m))
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 (t <= -7.5e+54) {
tmp = (-2.0 / z_m) * (x_m / t);
} else if (t <= 1.15e-8) {
tmp = x_m * (2.0 / (y * z_m));
} 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 t <= -7.5e+54: tmp = (-2.0 / z_m) * (x_m / t) elif t <= 1.15e-8: tmp = x_m * (2.0 / (y * z_m)) 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 (t <= -7.5e+54) tmp = Float64(Float64(-2.0 / z_m) * Float64(x_m / t)); elseif (t <= 1.15e-8) tmp = Float64(x_m * Float64(2.0 / Float64(y * z_m))); else tmp = Float64(-2.0 * Float64(Float64(x_m / 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 (t <= -7.5e+54) tmp = (-2.0 / z_m) * (x_m / t); elseif (t <= 1.15e-8) tmp = x_m * (2.0 / (y * z_m)); 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[LessEqual[t, -7.5e+54], N[(N[(-2.0 / z$95$m), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-8], N[(x$95$m * N[(2.0 / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z$95$m), $MachinePrecision] / t), $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 -7.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{-2}{z\_m} \cdot \frac{x\_m}{t}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-8}:\\
\;\;\;\;x\_m \cdot \frac{2}{y \cdot z\_m}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z\_m}}{t}\\
\end{array}\right)
\end{array}
if t < -7.50000000000000042e54Initial program 88.3%
distribute-rgt-out--90.1%
Simplified90.1%
Taylor expanded in y around 0 76.7%
associate-*r*76.7%
neg-mul-176.7%
*-commutative76.7%
Simplified76.7%
frac-2neg76.7%
*-commutative76.7%
distribute-lft-neg-in76.7%
metadata-eval76.7%
distribute-rgt-neg-out76.7%
remove-double-neg76.7%
times-frac78.2%
Applied egg-rr78.2%
if -7.50000000000000042e54 < t < 1.15e-8Initial program 91.7%
distribute-rgt-out--94.0%
Simplified94.0%
Taylor expanded in y around inf 78.1%
*-commutative78.1%
Simplified78.1%
associate-/l*78.1%
*-commutative78.1%
*-commutative78.1%
Applied egg-rr78.1%
if 1.15e-8 < t Initial program 87.4%
distribute-rgt-out--88.9%
Simplified88.9%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
associate-/r*83.5%
Simplified83.5%
Final simplification79.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 (<= t -7.5e+54)
(* (/ -2.0 z_m) (/ x_m t))
(if (<= t 2e-7) (* 2.0 (/ (/ x_m 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 (t <= -7.5e+54) {
tmp = (-2.0 / z_m) * (x_m / t);
} else if (t <= 2e-7) {
tmp = 2.0 * ((x_m / 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 (t <= (-7.5d+54)) then
tmp = ((-2.0d0) / z_m) * (x_m / t)
else if (t <= 2d-7) then
tmp = 2.0d0 * ((x_m / 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 (t <= -7.5e+54) {
tmp = (-2.0 / z_m) * (x_m / t);
} else if (t <= 2e-7) {
tmp = 2.0 * ((x_m / 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 t <= -7.5e+54: tmp = (-2.0 / z_m) * (x_m / t) elif t <= 2e-7: tmp = 2.0 * ((x_m / 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 (t <= -7.5e+54) tmp = Float64(Float64(-2.0 / z_m) * Float64(x_m / t)); elseif (t <= 2e-7) tmp = Float64(2.0 * Float64(Float64(x_m / z_m) / y)); else tmp = Float64(-2.0 * Float64(Float64(x_m / 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 (t <= -7.5e+54) tmp = (-2.0 / z_m) * (x_m / t); elseif (t <= 2e-7) tmp = 2.0 * ((x_m / 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[LessEqual[t, -7.5e+54], N[(N[(-2.0 / z$95$m), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e-7], N[(2.0 * N[(N[(x$95$m / z$95$m), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z$95$m), $MachinePrecision] / t), $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 -7.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{-2}{z\_m} \cdot \frac{x\_m}{t}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-7}:\\
\;\;\;\;2 \cdot \frac{\frac{x\_m}{z\_m}}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z\_m}}{t}\\
\end{array}\right)
\end{array}
if t < -7.50000000000000042e54Initial program 88.3%
distribute-rgt-out--90.1%
Simplified90.1%
Taylor expanded in y around 0 76.7%
associate-*r*76.7%
neg-mul-176.7%
*-commutative76.7%
Simplified76.7%
frac-2neg76.7%
*-commutative76.7%
distribute-lft-neg-in76.7%
metadata-eval76.7%
distribute-rgt-neg-out76.7%
remove-double-neg76.7%
times-frac78.2%
Applied egg-rr78.2%
if -7.50000000000000042e54 < t < 1.9999999999999999e-7Initial program 91.7%
distribute-rgt-out--94.0%
Simplified94.0%
*-commutative94.0%
times-frac90.9%
Applied egg-rr90.9%
Taylor expanded in y around inf 78.1%
*-commutative78.1%
associate-/r*77.3%
Simplified77.3%
if 1.9999999999999999e-7 < t Initial program 87.4%
distribute-rgt-out--88.9%
Simplified88.9%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
associate-/r*83.5%
Simplified83.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 (<= t -1.32e+55)
(* -2.0 (/ x_m (* z_m t)))
(if (<= t 1.45e-6)
(* 2.0 (/ (/ x_m 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 (t <= -1.32e+55) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (t <= 1.45e-6) {
tmp = 2.0 * ((x_m / 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 (t <= (-1.32d+55)) then
tmp = (-2.0d0) * (x_m / (z_m * t))
else if (t <= 1.45d-6) then
tmp = 2.0d0 * ((x_m / 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 (t <= -1.32e+55) {
tmp = -2.0 * (x_m / (z_m * t));
} else if (t <= 1.45e-6) {
tmp = 2.0 * ((x_m / 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 t <= -1.32e+55: tmp = -2.0 * (x_m / (z_m * t)) elif t <= 1.45e-6: tmp = 2.0 * ((x_m / 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 (t <= -1.32e+55) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); elseif (t <= 1.45e-6) tmp = Float64(2.0 * Float64(Float64(x_m / z_m) / y)); else tmp = Float64(-2.0 * Float64(Float64(x_m / 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 (t <= -1.32e+55) tmp = -2.0 * (x_m / (z_m * t)); elseif (t <= 1.45e-6) tmp = 2.0 * ((x_m / 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[LessEqual[t, -1.32e+55], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.45e-6], N[(2.0 * N[(N[(x$95$m / z$95$m), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z$95$m), $MachinePrecision] / t), $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 -1.32 \cdot 10^{+55}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-6}:\\
\;\;\;\;2 \cdot \frac{\frac{x\_m}{z\_m}}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z\_m}}{t}\\
\end{array}\right)
\end{array}
if t < -1.32e55Initial program 88.3%
distribute-rgt-out--90.1%
Simplified90.1%
Taylor expanded in y around 0 76.6%
*-commutative76.6%
Simplified76.6%
if -1.32e55 < t < 1.4500000000000001e-6Initial program 91.7%
distribute-rgt-out--94.0%
Simplified94.0%
*-commutative94.0%
times-frac90.9%
Applied egg-rr90.9%
Taylor expanded in y around inf 78.1%
*-commutative78.1%
associate-/r*77.3%
Simplified77.3%
if 1.4500000000000001e-6 < t Initial program 87.4%
distribute-rgt-out--88.9%
Simplified88.9%
Taylor expanded in y around 0 79.2%
*-commutative79.2%
associate-/r*83.5%
Simplified83.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 (<= (* x_m 2.0) 2000.0)
(/ (* -2.0 (/ x_m z_m)) (- t y))
(* (/ 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) <= 2000.0) {
tmp = (-2.0 * (x_m / z_m)) / (t - y);
} 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) <= 2000.0d0) then
tmp = ((-2.0d0) * (x_m / z_m)) / (t - y)
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) <= 2000.0) {
tmp = (-2.0 * (x_m / z_m)) / (t - y);
} 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) <= 2000.0: tmp = (-2.0 * (x_m / z_m)) / (t - y) 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) <= 2000.0) tmp = Float64(Float64(-2.0 * Float64(x_m / z_m)) / Float64(t - y)); 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) <= 2000.0) tmp = (-2.0 * (x_m / z_m)) / (t - y); 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], 2000.0], N[(N[(-2.0 * N[(x$95$m / z$95$m), $MachinePrecision]), $MachinePrecision] / N[(t - y), $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 2000:\\
\;\;\;\;\frac{-2 \cdot \frac{x\_m}{z\_m}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z\_m}\\
\end{array}\right)
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 2e3Initial program 92.2%
distribute-rgt-out--93.2%
Simplified93.2%
Taylor expanded in x around 0 93.2%
associate-*r/93.2%
metadata-eval93.2%
distribute-lft-neg-in93.2%
*-commutative93.2%
distribute-neg-frac93.2%
associate-/r*95.3%
*-commutative95.3%
associate-*r/95.3%
distribute-neg-frac295.3%
neg-sub095.3%
sub-neg95.3%
+-commutative95.3%
associate--r+95.3%
neg-sub095.3%
remove-double-neg95.3%
Simplified95.3%
if 2e3 < (*.f64 x #s(literal 2 binary64)) Initial program 81.7%
distribute-rgt-out--86.8%
Simplified86.8%
*-commutative86.8%
times-frac96.3%
Applied egg-rr96.3%
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) 3e+26)
(* (/ 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) <= 3e+26) {
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) <= 3d+26) 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) <= 3e+26) {
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) <= 3e+26: 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) <= 3e+26) 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) <= 3e+26) 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], 3e+26], 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 3 \cdot 10^{+26}:\\
\;\;\;\;\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 #s(literal 2 binary64)) < 2.99999999999999997e26Initial program 92.3%
distribute-rgt-out--93.4%
Simplified93.4%
times-frac95.3%
Applied egg-rr95.3%
if 2.99999999999999997e26 < (*.f64 x #s(literal 2 binary64)) Initial program 80.1%
distribute-rgt-out--85.7%
Simplified85.7%
*-commutative85.7%
times-frac96.0%
Applied egg-rr96.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
(*
z_s
(*
x_s
(if (<= z_m 9.5e-55)
(* x_m (/ 2.0 (* z_m (- y t))))
(* (/ x_m z_m) (/ 2.0 (- 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 <= 9.5e-55) {
tmp = x_m * (2.0 / (z_m * (y - t)));
} else {
tmp = (x_m / z_m) * (2.0 / (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 <= 9.5d-55) then
tmp = x_m * (2.0d0 / (z_m * (y - t)))
else
tmp = (x_m / z_m) * (2.0d0 / (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 <= 9.5e-55) {
tmp = x_m * (2.0 / (z_m * (y - t)));
} else {
tmp = (x_m / z_m) * (2.0 / (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 <= 9.5e-55: tmp = x_m * (2.0 / (z_m * (y - t))) else: tmp = (x_m / z_m) * (2.0 / (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 <= 9.5e-55) tmp = Float64(x_m * Float64(2.0 / Float64(z_m * Float64(y - t)))); else tmp = Float64(Float64(x_m / z_m) * Float64(2.0 / 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 <= 9.5e-55) tmp = x_m * (2.0 / (z_m * (y - t))); else tmp = (x_m / z_m) * (2.0 / (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, 9.5e-55], N[(x$95$m * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(2.0 / 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 9.5 \cdot 10^{-55}:\\
\;\;\;\;x\_m \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z\_m} \cdot \frac{2}{y - t}\\
\end{array}\right)
\end{array}
if z < 9.5000000000000006e-55Initial program 91.8%
distribute-rgt-out--93.5%
Simplified93.5%
distribute-rgt-out--91.8%
associate-/l*91.1%
*-commutative91.1%
distribute-rgt-out--92.8%
Applied egg-rr92.8%
if 9.5000000000000006e-55 < z Initial program 84.9%
distribute-rgt-out--87.5%
Simplified87.5%
times-frac95.5%
Applied egg-rr95.5%
Final simplification93.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 (<= z_m 3.6e-177)
(* -2.0 (/ x_m (* z_m t)))
(* -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 (z_m <= 3.6e-177) {
tmp = -2.0 * (x_m / (z_m * t));
} 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 (z_m <= 3.6d-177) then
tmp = (-2.0d0) * (x_m / (z_m * t))
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 (z_m <= 3.6e-177) {
tmp = -2.0 * (x_m / (z_m * t));
} 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 z_m <= 3.6e-177: tmp = -2.0 * (x_m / (z_m * t)) 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 (z_m <= 3.6e-177) tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t))); else tmp = Float64(-2.0 * Float64(Float64(x_m / 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 (z_m <= 3.6e-177) tmp = -2.0 * (x_m / (z_m * t)); 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[LessEqual[z$95$m, 3.6e-177], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z$95$m), $MachinePrecision] / t), $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 3.6 \cdot 10^{-177}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z\_m}}{t}\\
\end{array}\right)
\end{array}
if z < 3.59999999999999983e-177Initial program 92.5%
distribute-rgt-out--93.9%
Simplified93.9%
Taylor expanded in y around 0 54.5%
*-commutative54.5%
Simplified54.5%
if 3.59999999999999983e-177 < z Initial program 86.0%
distribute-rgt-out--88.7%
Simplified88.7%
Taylor expanded in y around 0 55.9%
*-commutative55.9%
associate-/r*62.2%
Simplified62.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 (* x_m (/ 2.0 (* 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 * (x_m * (2.0 / (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 * (x_m * (2.0d0 / (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 * (x_m * (2.0 / (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 * (x_m * (2.0 / (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(x_m * Float64(2.0 / Float64(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 * (x_m * (2.0 / (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[(x$95$m * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $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(x\_m \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\right)\right)
\end{array}
Initial program 89.8%
distribute-rgt-out--91.7%
Simplified91.7%
distribute-rgt-out--89.8%
associate-/l*89.2%
*-commutative89.2%
distribute-rgt-out--91.2%
Applied egg-rr91.2%
Final simplification91.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 (* -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.8%
distribute-rgt-out--91.7%
Simplified91.7%
Taylor expanded in y around 0 55.1%
*-commutative55.1%
Simplified55.1%
(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 2024163
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (* x 2) (- (* y z) (* t z))) -2559141628295061/10000000000000000000000000000) (* (/ x (* (- y t) z)) 2) (if (< (/ (* x 2) (- (* y z) (* t z))) 522513913665063/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2))))
(/ (* x 2.0) (- (* y z) (* t z))))