
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= z_m 9e-37)
(/ (* x 2.0) (* z_m (- y t)))
(* (/ x (- y t)) (/ 2.0 z_m)))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 9e-37) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = (x / (y - t)) * (2.0 / z_m);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (z_m <= 9d-37) then
tmp = (x * 2.0d0) / (z_m * (y - t))
else
tmp = (x / (y - t)) * (2.0d0 / z_m)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 9e-37) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = (x / (y - t)) * (2.0 / z_m);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if z_m <= 9e-37: tmp = (x * 2.0) / (z_m * (y - t)) else: tmp = (x / (y - t)) * (2.0 / z_m) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (z_m <= 9e-37) tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t))); else tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z_m)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (z_m <= 9e-37) tmp = (x * 2.0) / (z_m * (y - t)); else tmp = (x / (y - t)) * (2.0 / z_m); end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[z$95$m, 9e-37], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 9 \cdot 10^{-37}:\\
\;\;\;\;\frac{x \cdot 2}{z_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z_m}\\
\end{array}
\end{array}
if z < 9.00000000000000081e-37Initial program 90.2%
distribute-rgt-out--92.0%
Simplified92.0%
if 9.00000000000000081e-37 < z Initial program 82.9%
distribute-rgt-out--84.2%
Simplified84.2%
*-commutative84.2%
times-frac99.6%
Applied egg-rr99.6%
Final simplification94.5%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -3.65e+241)
(/ -2.0 (* t (/ z_m x)))
(if (<= t -2.7e-37)
(* -2.0 (/ (/ x t) z_m))
(if (<= t 2.5e+54)
(* (/ x z_m) (/ 2.0 y))
(* (/ 2.0 z_m) (/ (- x) t)))))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.65e+241) {
tmp = -2.0 / (t * (z_m / x));
} else if (t <= -2.7e-37) {
tmp = -2.0 * ((x / t) / z_m);
} else if (t <= 2.5e+54) {
tmp = (x / z_m) * (2.0 / y);
} else {
tmp = (2.0 / z_m) * (-x / t);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.65d+241)) then
tmp = (-2.0d0) / (t * (z_m / x))
else if (t <= (-2.7d-37)) then
tmp = (-2.0d0) * ((x / t) / z_m)
else if (t <= 2.5d+54) then
tmp = (x / z_m) * (2.0d0 / y)
else
tmp = (2.0d0 / z_m) * (-x / t)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.65e+241) {
tmp = -2.0 / (t * (z_m / x));
} else if (t <= -2.7e-37) {
tmp = -2.0 * ((x / t) / z_m);
} else if (t <= 2.5e+54) {
tmp = (x / z_m) * (2.0 / y);
} else {
tmp = (2.0 / z_m) * (-x / t);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if t <= -3.65e+241: tmp = -2.0 / (t * (z_m / x)) elif t <= -2.7e-37: tmp = -2.0 * ((x / t) / z_m) elif t <= 2.5e+54: tmp = (x / z_m) * (2.0 / y) else: tmp = (2.0 / z_m) * (-x / t) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (t <= -3.65e+241) tmp = Float64(-2.0 / Float64(t * Float64(z_m / x))); elseif (t <= -2.7e-37) tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); elseif (t <= 2.5e+54) tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); else tmp = Float64(Float64(2.0 / z_m) * Float64(Float64(-x) / t)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (t <= -3.65e+241) tmp = -2.0 / (t * (z_m / x)); elseif (t <= -2.7e-37) tmp = -2.0 * ((x / t) / z_m); elseif (t <= 2.5e+54) tmp = (x / z_m) * (2.0 / y); else tmp = (2.0 / z_m) * (-x / t); end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -3.65e+241], N[(-2.0 / N[(t * N[(z$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.7e-37], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+54], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[((-x) / t), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z_m}{x}}\\
\mathbf{elif}\;t \leq -2.7 \cdot 10^{-37}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{x}{z_m} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z_m} \cdot \frac{-x}{t}\\
\end{array}
\end{array}
if t < -3.6500000000000001e241Initial program 71.8%
*-commutative71.8%
associate-*l/71.8%
*-commutative71.8%
distribute-rgt-out--71.8%
associate-/l/72.0%
Simplified72.0%
Taylor expanded in y around 0 60.6%
associate-/r*60.8%
Simplified60.8%
associate-*r/63.1%
associate-*l/88.1%
clear-num88.1%
frac-times88.6%
metadata-eval88.6%
Applied egg-rr88.6%
if -3.6500000000000001e241 < t < -2.70000000000000016e-37Initial program 90.1%
*-commutative90.1%
associate-*l/90.1%
*-commutative90.1%
distribute-rgt-out--92.1%
associate-/l/93.2%
Simplified93.2%
Taylor expanded in y around 0 72.6%
associate-/r*80.8%
Simplified80.8%
if -2.70000000000000016e-37 < t < 2.50000000000000003e54Initial program 88.9%
distribute-rgt-out--90.4%
times-frac95.0%
Simplified95.0%
Taylor expanded in y around inf 82.2%
if 2.50000000000000003e54 < t Initial program 87.7%
distribute-rgt-out--90.0%
Simplified90.0%
*-commutative90.0%
times-frac95.8%
Applied egg-rr95.8%
Taylor expanded in y around 0 81.7%
associate-*r/81.7%
neg-mul-181.7%
Simplified81.7%
Final simplification82.3%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -3.65e+241)
(* (/ x z_m) (/ -2.0 t))
(if (or (<= t -2.6e-37) (not (<= t 6e-23)))
(* -2.0 (/ (/ x t) z_m))
(* (/ 2.0 z_m) (/ x y))))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.65e+241) {
tmp = (x / z_m) * (-2.0 / t);
} else if ((t <= -2.6e-37) || !(t <= 6e-23)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = (2.0 / z_m) * (x / y);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.65d+241)) then
tmp = (x / z_m) * ((-2.0d0) / t)
else if ((t <= (-2.6d-37)) .or. (.not. (t <= 6d-23))) then
tmp = (-2.0d0) * ((x / t) / z_m)
else
tmp = (2.0d0 / z_m) * (x / y)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.65e+241) {
tmp = (x / z_m) * (-2.0 / t);
} else if ((t <= -2.6e-37) || !(t <= 6e-23)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = (2.0 / z_m) * (x / y);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if t <= -3.65e+241: tmp = (x / z_m) * (-2.0 / t) elif (t <= -2.6e-37) or not (t <= 6e-23): tmp = -2.0 * ((x / t) / z_m) else: tmp = (2.0 / z_m) * (x / y) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (t <= -3.65e+241) tmp = Float64(Float64(x / z_m) * Float64(-2.0 / t)); elseif ((t <= -2.6e-37) || !(t <= 6e-23)) tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); else tmp = Float64(Float64(2.0 / z_m) * Float64(x / y)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (t <= -3.65e+241) tmp = (x / z_m) * (-2.0 / t); elseif ((t <= -2.6e-37) || ~((t <= 6e-23))) tmp = -2.0 * ((x / t) / z_m); else tmp = (2.0 / z_m) * (x / y); end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -3.65e+241], N[(N[(x / z$95$m), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.6e-37], N[Not[LessEqual[t, 6e-23]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\
\;\;\;\;\frac{x}{z_m} \cdot \frac{-2}{t}\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-37} \lor \neg \left(t \leq 6 \cdot 10^{-23}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z_m} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if t < -3.6500000000000001e241Initial program 71.8%
distribute-rgt-out--71.8%
times-frac93.7%
Simplified93.7%
Taylor expanded in y around 0 88.1%
if -3.6500000000000001e241 < t < -2.5999999999999998e-37 or 6.00000000000000006e-23 < t Initial program 90.1%
*-commutative90.1%
associate-*l/90.1%
*-commutative90.1%
distribute-rgt-out--91.8%
associate-/l/93.1%
Simplified93.1%
Taylor expanded in y around 0 69.6%
associate-/r*77.1%
Simplified77.1%
if -2.5999999999999998e-37 < t < 6.00000000000000006e-23Initial program 87.7%
distribute-rgt-out--89.4%
Simplified89.4%
*-commutative89.4%
times-frac92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 81.6%
Final simplification79.9%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -3.65e+241)
(* (/ x z_m) (/ -2.0 t))
(if (or (<= t -2.05e-37) (not (<= t 6.8e+64)))
(* -2.0 (/ (/ x t) z_m))
(* (/ x z_m) (/ 2.0 y))))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.65e+241) {
tmp = (x / z_m) * (-2.0 / t);
} else if ((t <= -2.05e-37) || !(t <= 6.8e+64)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = (x / z_m) * (2.0 / y);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.65d+241)) then
tmp = (x / z_m) * ((-2.0d0) / t)
else if ((t <= (-2.05d-37)) .or. (.not. (t <= 6.8d+64))) then
tmp = (-2.0d0) * ((x / t) / z_m)
else
tmp = (x / z_m) * (2.0d0 / y)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.65e+241) {
tmp = (x / z_m) * (-2.0 / t);
} else if ((t <= -2.05e-37) || !(t <= 6.8e+64)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = (x / z_m) * (2.0 / y);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if t <= -3.65e+241: tmp = (x / z_m) * (-2.0 / t) elif (t <= -2.05e-37) or not (t <= 6.8e+64): tmp = -2.0 * ((x / t) / z_m) else: tmp = (x / z_m) * (2.0 / y) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (t <= -3.65e+241) tmp = Float64(Float64(x / z_m) * Float64(-2.0 / t)); elseif ((t <= -2.05e-37) || !(t <= 6.8e+64)) tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); else tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (t <= -3.65e+241) tmp = (x / z_m) * (-2.0 / t); elseif ((t <= -2.05e-37) || ~((t <= 6.8e+64))) tmp = -2.0 * ((x / t) / z_m); else tmp = (x / z_m) * (2.0 / y); end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -3.65e+241], N[(N[(x / z$95$m), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.05e-37], N[Not[LessEqual[t, 6.8e+64]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\
\;\;\;\;\frac{x}{z_m} \cdot \frac{-2}{t}\\
\mathbf{elif}\;t \leq -2.05 \cdot 10^{-37} \lor \neg \left(t \leq 6.8 \cdot 10^{+64}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z_m} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if t < -3.6500000000000001e241Initial program 71.8%
distribute-rgt-out--71.8%
times-frac93.7%
Simplified93.7%
Taylor expanded in y around 0 88.1%
if -3.6500000000000001e241 < t < -2.0499999999999999e-37 or 6.8000000000000003e64 < t Initial program 88.5%
*-commutative88.5%
associate-*l/88.4%
*-commutative88.4%
distribute-rgt-out--90.6%
associate-/l/92.3%
Simplified92.3%
Taylor expanded in y around 0 73.0%
associate-/r*82.5%
Simplified82.5%
if -2.0499999999999999e-37 < t < 6.8000000000000003e64Initial program 89.2%
distribute-rgt-out--90.6%
times-frac95.2%
Simplified95.2%
Taylor expanded in y around inf 81.4%
Final simplification82.2%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -3.65e+241)
(/ -2.0 (* t (/ z_m x)))
(if (or (<= t -3.3e-37) (not (<= t 1.1e+65)))
(* -2.0 (/ (/ x t) z_m))
(* (/ x z_m) (/ 2.0 y))))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.65e+241) {
tmp = -2.0 / (t * (z_m / x));
} else if ((t <= -3.3e-37) || !(t <= 1.1e+65)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = (x / z_m) * (2.0 / y);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.65d+241)) then
tmp = (-2.0d0) / (t * (z_m / x))
else if ((t <= (-3.3d-37)) .or. (.not. (t <= 1.1d+65))) then
tmp = (-2.0d0) * ((x / t) / z_m)
else
tmp = (x / z_m) * (2.0d0 / y)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.65e+241) {
tmp = -2.0 / (t * (z_m / x));
} else if ((t <= -3.3e-37) || !(t <= 1.1e+65)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = (x / z_m) * (2.0 / y);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if t <= -3.65e+241: tmp = -2.0 / (t * (z_m / x)) elif (t <= -3.3e-37) or not (t <= 1.1e+65): tmp = -2.0 * ((x / t) / z_m) else: tmp = (x / z_m) * (2.0 / y) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (t <= -3.65e+241) tmp = Float64(-2.0 / Float64(t * Float64(z_m / x))); elseif ((t <= -3.3e-37) || !(t <= 1.1e+65)) tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); else tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (t <= -3.65e+241) tmp = -2.0 / (t * (z_m / x)); elseif ((t <= -3.3e-37) || ~((t <= 1.1e+65))) tmp = -2.0 * ((x / t) / z_m); else tmp = (x / z_m) * (2.0 / y); end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -3.65e+241], N[(-2.0 / N[(t * N[(z$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -3.3e-37], N[Not[LessEqual[t, 1.1e+65]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z_m}{x}}\\
\mathbf{elif}\;t \leq -3.3 \cdot 10^{-37} \lor \neg \left(t \leq 1.1 \cdot 10^{+65}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z_m} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if t < -3.6500000000000001e241Initial program 71.8%
*-commutative71.8%
associate-*l/71.8%
*-commutative71.8%
distribute-rgt-out--71.8%
associate-/l/72.0%
Simplified72.0%
Taylor expanded in y around 0 60.6%
associate-/r*60.8%
Simplified60.8%
associate-*r/63.1%
associate-*l/88.1%
clear-num88.1%
frac-times88.6%
metadata-eval88.6%
Applied egg-rr88.6%
if -3.6500000000000001e241 < t < -3.29999999999999982e-37 or 1.0999999999999999e65 < t Initial program 88.5%
*-commutative88.5%
associate-*l/88.4%
*-commutative88.4%
distribute-rgt-out--90.6%
associate-/l/92.3%
Simplified92.3%
Taylor expanded in y around 0 73.0%
associate-/r*82.5%
Simplified82.5%
if -3.29999999999999982e-37 < t < 1.0999999999999999e65Initial program 89.2%
distribute-rgt-out--90.6%
times-frac95.2%
Simplified95.2%
Taylor expanded in y around inf 81.4%
Final simplification82.3%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -3.65e+241)
(/ -2.0 (* t (/ z_m x)))
(if (<= t -3.15e-37)
(* -2.0 (/ (/ x t) z_m))
(if (<= t 6.2e+49) (* (/ x z_m) (/ 2.0 y)) (/ (/ (* x -2.0) t) z_m))))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.65e+241) {
tmp = -2.0 / (t * (z_m / x));
} else if (t <= -3.15e-37) {
tmp = -2.0 * ((x / t) / z_m);
} else if (t <= 6.2e+49) {
tmp = (x / z_m) * (2.0 / y);
} else {
tmp = ((x * -2.0) / t) / z_m;
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.65d+241)) then
tmp = (-2.0d0) / (t * (z_m / x))
else if (t <= (-3.15d-37)) then
tmp = (-2.0d0) * ((x / t) / z_m)
else if (t <= 6.2d+49) then
tmp = (x / z_m) * (2.0d0 / y)
else
tmp = ((x * (-2.0d0)) / t) / z_m
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.65e+241) {
tmp = -2.0 / (t * (z_m / x));
} else if (t <= -3.15e-37) {
tmp = -2.0 * ((x / t) / z_m);
} else if (t <= 6.2e+49) {
tmp = (x / z_m) * (2.0 / y);
} else {
tmp = ((x * -2.0) / t) / z_m;
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if t <= -3.65e+241: tmp = -2.0 / (t * (z_m / x)) elif t <= -3.15e-37: tmp = -2.0 * ((x / t) / z_m) elif t <= 6.2e+49: tmp = (x / z_m) * (2.0 / y) else: tmp = ((x * -2.0) / t) / z_m return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (t <= -3.65e+241) tmp = Float64(-2.0 / Float64(t * Float64(z_m / x))); elseif (t <= -3.15e-37) tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); elseif (t <= 6.2e+49) tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); else tmp = Float64(Float64(Float64(x * -2.0) / t) / z_m); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (t <= -3.65e+241) tmp = -2.0 / (t * (z_m / x)); elseif (t <= -3.15e-37) tmp = -2.0 * ((x / t) / z_m); elseif (t <= 6.2e+49) tmp = (x / z_m) * (2.0 / y); else tmp = ((x * -2.0) / t) / z_m; end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -3.65e+241], N[(-2.0 / N[(t * N[(z$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.15e-37], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+49], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * -2.0), $MachinePrecision] / t), $MachinePrecision] / z$95$m), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z_m}{x}}\\
\mathbf{elif}\;t \leq -3.15 \cdot 10^{-37}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{x}{z_m} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{t}}{z_m}\\
\end{array}
\end{array}
if t < -3.6500000000000001e241Initial program 71.8%
*-commutative71.8%
associate-*l/71.8%
*-commutative71.8%
distribute-rgt-out--71.8%
associate-/l/72.0%
Simplified72.0%
Taylor expanded in y around 0 60.6%
associate-/r*60.8%
Simplified60.8%
associate-*r/63.1%
associate-*l/88.1%
clear-num88.1%
frac-times88.6%
metadata-eval88.6%
Applied egg-rr88.6%
if -3.6500000000000001e241 < t < -3.15000000000000011e-37Initial program 90.1%
*-commutative90.1%
associate-*l/90.1%
*-commutative90.1%
distribute-rgt-out--92.1%
associate-/l/93.2%
Simplified93.2%
Taylor expanded in y around 0 72.6%
associate-/r*80.8%
Simplified80.8%
if -3.15000000000000011e-37 < t < 6.19999999999999985e49Initial program 88.9%
distribute-rgt-out--90.4%
times-frac95.0%
Simplified95.0%
Taylor expanded in y around inf 82.2%
if 6.19999999999999985e49 < t Initial program 87.7%
*-commutative87.7%
associate-*l/87.6%
*-commutative87.6%
distribute-rgt-out--89.9%
associate-/l/91.9%
Simplified91.9%
Taylor expanded in y around 0 71.7%
*-commutative71.7%
associate-*l/71.7%
associate-/r*81.7%
Applied egg-rr81.7%
Final simplification82.3%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (or (<= t -3.2e-37) (not (<= t 7e-23)))
(* -2.0 (/ (/ x t) z_m))
(* x (/ (/ 2.0 y) z_m)))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if ((t <= -3.2e-37) || !(t <= 7e-23)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = x * ((2.0 / y) / z_m);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-3.2d-37)) .or. (.not. (t <= 7d-23))) then
tmp = (-2.0d0) * ((x / t) / z_m)
else
tmp = x * ((2.0d0 / y) / z_m)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if ((t <= -3.2e-37) || !(t <= 7e-23)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = x * ((2.0 / y) / z_m);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if (t <= -3.2e-37) or not (t <= 7e-23): tmp = -2.0 * ((x / t) / z_m) else: tmp = x * ((2.0 / y) / z_m) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if ((t <= -3.2e-37) || !(t <= 7e-23)) tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); else tmp = Float64(x * Float64(Float64(2.0 / y) / z_m)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if ((t <= -3.2e-37) || ~((t <= 7e-23))) tmp = -2.0 * ((x / t) / z_m); else tmp = x * ((2.0 / y) / z_m); end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[Or[LessEqual[t, -3.2e-37], N[Not[LessEqual[t, 7e-23]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-37} \lor \neg \left(t \leq 7 \cdot 10^{-23}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z_m}\\
\end{array}
\end{array}
if t < -3.1999999999999999e-37 or 6.99999999999999987e-23 < t Initial program 87.9%
*-commutative87.9%
associate-*l/87.8%
*-commutative87.8%
distribute-rgt-out--89.4%
associate-/l/90.5%
Simplified90.5%
Taylor expanded in y around 0 68.5%
associate-/r*75.3%
Simplified75.3%
if -3.1999999999999999e-37 < t < 6.99999999999999987e-23Initial program 87.7%
*-commutative87.7%
associate-*l/87.6%
*-commutative87.6%
distribute-rgt-out--89.3%
associate-/l/90.3%
Simplified90.3%
Taylor expanded in y around inf 79.3%
associate-/r*80.3%
Simplified80.3%
Final simplification77.6%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (or (<= t -1.9e-37) (not (<= t 4.3e-23)))
(* -2.0 (/ (/ x t) z_m))
(* (/ 2.0 z_m) (/ x y)))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if ((t <= -1.9e-37) || !(t <= 4.3e-23)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = (2.0 / z_m) * (x / y);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.9d-37)) .or. (.not. (t <= 4.3d-23))) then
tmp = (-2.0d0) * ((x / t) / z_m)
else
tmp = (2.0d0 / z_m) * (x / y)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if ((t <= -1.9e-37) || !(t <= 4.3e-23)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = (2.0 / z_m) * (x / y);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if (t <= -1.9e-37) or not (t <= 4.3e-23): tmp = -2.0 * ((x / t) / z_m) else: tmp = (2.0 / z_m) * (x / y) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if ((t <= -1.9e-37) || !(t <= 4.3e-23)) tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); else tmp = Float64(Float64(2.0 / z_m) * Float64(x / y)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if ((t <= -1.9e-37) || ~((t <= 4.3e-23))) tmp = -2.0 * ((x / t) / z_m); else tmp = (2.0 / z_m) * (x / y); end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[Or[LessEqual[t, -1.9e-37], N[Not[LessEqual[t, 4.3e-23]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-37} \lor \neg \left(t \leq 4.3 \cdot 10^{-23}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z_m} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if t < -1.9000000000000002e-37 or 4.30000000000000002e-23 < t Initial program 87.9%
*-commutative87.9%
associate-*l/87.8%
*-commutative87.8%
distribute-rgt-out--89.4%
associate-/l/90.5%
Simplified90.5%
Taylor expanded in y around 0 68.5%
associate-/r*75.3%
Simplified75.3%
if -1.9000000000000002e-37 < t < 4.30000000000000002e-23Initial program 87.7%
distribute-rgt-out--89.4%
Simplified89.4%
*-commutative89.4%
times-frac92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 81.6%
Final simplification78.2%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -3.4e+252)
(/ -2.0 (* t (/ z_m x)))
(* x (/ (/ 2.0 (- y t)) z_m)))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.4e+252) {
tmp = -2.0 / (t * (z_m / x));
} else {
tmp = x * ((2.0 / (y - t)) / z_m);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.4d+252)) then
tmp = (-2.0d0) / (t * (z_m / x))
else
tmp = x * ((2.0d0 / (y - t)) / z_m)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.4e+252) {
tmp = -2.0 / (t * (z_m / x));
} else {
tmp = x * ((2.0 / (y - t)) / z_m);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if t <= -3.4e+252: tmp = -2.0 / (t * (z_m / x)) else: tmp = x * ((2.0 / (y - t)) / z_m) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (t <= -3.4e+252) tmp = Float64(-2.0 / Float64(t * Float64(z_m / x))); else tmp = Float64(x * Float64(Float64(2.0 / Float64(y - t)) / z_m)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (t <= -3.4e+252) tmp = -2.0 / (t * (z_m / x)); else tmp = x * ((2.0 / (y - t)) / z_m); end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -3.4e+252], N[(-2.0 / N[(t * N[(z$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+252}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z_m}{x}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y - t}}{z_m}\\
\end{array}
\end{array}
if t < -3.4e252Initial program 63.3%
*-commutative63.3%
associate-*l/63.4%
*-commutative63.4%
distribute-rgt-out--63.4%
associate-/l/63.5%
Simplified63.5%
Taylor expanded in y around 0 63.4%
associate-/r*63.5%
Simplified63.5%
associate-*r/77.7%
associate-*l/99.3%
clear-num99.3%
frac-times99.9%
metadata-eval99.9%
Applied egg-rr99.9%
if -3.4e252 < t Initial program 89.1%
*-commutative89.1%
associate-*l/89.0%
*-commutative89.0%
distribute-rgt-out--90.7%
associate-/l/91.9%
Simplified91.9%
Final simplification92.3%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m t) :precision binary64 (let* ((t_1 (/ 2.0 (- y t)))) (* z_s (if (<= z_m 7.5e-51) (* x (/ t_1 z_m)) (* t_1 (/ x z_m))))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double t_1 = 2.0 / (y - t);
double tmp;
if (z_m <= 7.5e-51) {
tmp = x * (t_1 / z_m);
} else {
tmp = t_1 * (x / z_m);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 / (y - t)
if (z_m <= 7.5d-51) then
tmp = x * (t_1 / z_m)
else
tmp = t_1 * (x / z_m)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double t_1 = 2.0 / (y - t);
double tmp;
if (z_m <= 7.5e-51) {
tmp = x * (t_1 / z_m);
} else {
tmp = t_1 * (x / z_m);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): t_1 = 2.0 / (y - t) tmp = 0 if z_m <= 7.5e-51: tmp = x * (t_1 / z_m) else: tmp = t_1 * (x / z_m) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) t_1 = Float64(2.0 / Float64(y - t)) tmp = 0.0 if (z_m <= 7.5e-51) tmp = Float64(x * Float64(t_1 / z_m)); else tmp = Float64(t_1 * Float64(x / z_m)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) t_1 = 2.0 / (y - t); tmp = 0.0; if (z_m <= 7.5e-51) tmp = x * (t_1 / z_m); else tmp = t_1 * (x / z_m); end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * If[LessEqual[z$95$m, 7.5e-51], N[(x * N[(t$95$1 / z$95$m), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(x / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := \frac{2}{y - t}\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 7.5 \cdot 10^{-51}:\\
\;\;\;\;x \cdot \frac{t_1}{z_m}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{x}{z_m}\\
\end{array}
\end{array}
\end{array}
if z < 7.49999999999999976e-51Initial program 90.1%
*-commutative90.1%
associate-*l/90.0%
*-commutative90.0%
distribute-rgt-out--91.8%
associate-/l/93.2%
Simplified93.2%
if 7.49999999999999976e-51 < z Initial program 83.3%
distribute-rgt-out--84.6%
times-frac95.3%
Simplified95.3%
Final simplification93.9%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= z_m 2.3e-37)
(* x (/ (/ 2.0 (- y t)) z_m))
(* (/ x (- y t)) (/ 2.0 z_m)))))z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 2.3e-37) {
tmp = x * ((2.0 / (y - t)) / z_m);
} else {
tmp = (x / (y - t)) * (2.0 / z_m);
}
return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (z_m <= 2.3d-37) then
tmp = x * ((2.0d0 / (y - t)) / z_m)
else
tmp = (x / (y - t)) * (2.0d0 / z_m)
end if
code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 2.3e-37) {
tmp = x * ((2.0 / (y - t)) / z_m);
} else {
tmp = (x / (y - t)) * (2.0 / z_m);
}
return z_s * tmp;
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if z_m <= 2.3e-37: tmp = x * ((2.0 / (y - t)) / z_m) else: tmp = (x / (y - t)) * (2.0 / z_m) return z_s * tmp
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (z_m <= 2.3e-37) tmp = Float64(x * Float64(Float64(2.0 / Float64(y - t)) / z_m)); else tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z_m)); end return Float64(z_s * tmp) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (z_m <= 2.3e-37) tmp = x * ((2.0 / (y - t)) / z_m); else tmp = (x / (y - t)) * (2.0 / z_m); end tmp_2 = z_s * tmp; end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[z$95$m, 2.3e-37], N[(x * N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 2.3 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y - t}}{z_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z_m}\\
\end{array}
\end{array}
if z < 2.3e-37Initial program 90.2%
*-commutative90.2%
associate-*l/90.1%
*-commutative90.1%
distribute-rgt-out--91.9%
associate-/l/93.2%
Simplified93.2%
if 2.3e-37 < z Initial program 82.9%
distribute-rgt-out--84.2%
Simplified84.2%
*-commutative84.2%
times-frac99.6%
Applied egg-rr99.6%
Final simplification95.4%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m t) :precision binary64 (* z_s (* -2.0 (/ x (* z_m t)))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (-2.0 * (x / (z_m * t)));
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
code = z_s * ((-2.0d0) * (x / (z_m * t)))
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (-2.0 * (x / (z_m * t)));
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): return z_s * (-2.0 * (x / (z_m * t)))
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) return Float64(z_s * Float64(-2.0 * Float64(x / Float64(z_m * t)))) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp = code(z_s, x, y, z_m, t) tmp = z_s * (-2.0 * (x / (z_m * t))); end
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_, y_, z$95$m_, t_] := N[(z$95$s * N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \left(-2 \cdot \frac{x}{z_m \cdot t}\right)
\end{array}
Initial program 87.8%
*-commutative87.8%
associate-*l/87.7%
*-commutative87.7%
distribute-rgt-out--89.3%
associate-/l/90.4%
Simplified90.4%
Taylor expanded in y around 0 45.8%
Final simplification45.8%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 z) (FPCore (z_s x y z_m t) :precision binary64 (* z_s (* -2.0 (/ (/ x t) z_m))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (-2.0 * ((x / t) / z_m));
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
code = z_s * ((-2.0d0) * ((x / t) / z_m))
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (-2.0 * ((x / t) / z_m));
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): return z_s * (-2.0 * ((x / t) / z_m))
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) return Float64(z_s * Float64(-2.0 * Float64(Float64(x / t) / z_m))) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp = code(z_s, x, y, z_m, t) tmp = z_s * (-2.0 * ((x / t) / z_m)); end
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_, y_, z$95$m_, t_] := N[(z$95$s * N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z_s \cdot \left(-2 \cdot \frac{\frac{x}{t}}{z_m}\right)
\end{array}
Initial program 87.8%
*-commutative87.8%
associate-*l/87.7%
*-commutative87.7%
distribute-rgt-out--89.3%
associate-/l/90.4%
Simplified90.4%
Taylor expanded in y around 0 45.8%
associate-/r*49.6%
Simplified49.6%
Final simplification49.6%
(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 2023334
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))