
(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 15 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)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= (* x_m 2.0) 2e-78)
(* (/ x_m -1.0) (/ (/ -2.0 z) (- y t)))
(/ (/ 2.0 z) (/ (- y t) x_m)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 2e-78) {
tmp = (x_m / -1.0) * ((-2.0 / z) / (y - t));
} else {
tmp = (2.0 / z) / ((y - t) / x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x_m * 2.0d0) <= 2d-78) then
tmp = (x_m / (-1.0d0)) * (((-2.0d0) / z) / (y - t))
else
tmp = (2.0d0 / z) / ((y - t) / x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 2e-78) {
tmp = (x_m / -1.0) * ((-2.0 / z) / (y - t));
} else {
tmp = (2.0 / z) / ((y - t) / x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (x_m * 2.0) <= 2e-78: tmp = (x_m / -1.0) * ((-2.0 / z) / (y - t)) else: tmp = (2.0 / z) / ((y - t) / x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (Float64(x_m * 2.0) <= 2e-78) tmp = Float64(Float64(x_m / -1.0) * Float64(Float64(-2.0 / z) / Float64(y - t))); else tmp = Float64(Float64(2.0 / z) / Float64(Float64(y - t) / x_m)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((x_m * 2.0) <= 2e-78) tmp = (x_m / -1.0) * ((-2.0 / z) / (y - t)); else tmp = (2.0 / z) / ((y - t) / x_m); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[N[(x$95$m * 2.0), $MachinePrecision], 2e-78], N[(N[(x$95$m / -1.0), $MachinePrecision] * N[(N[(-2.0 / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] / N[(N[(y - t), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \cdot 2 \leq 2 \cdot 10^{-78}:\\
\;\;\;\;\frac{x\_m}{-1} \cdot \frac{\frac{-2}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{z}}{\frac{y - t}{x\_m}}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 2e-78Initial program 92.0%
Applied egg-rr0
if 2e-78 < (*.f64 x #s(literal 2 binary64)) Initial program 86.0%
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -1.08e+20)
(/ (* (/ -2.0 t) x_m) z)
(if (<= t 4e-185)
(/ (/ (* x_m 2.0) z) y)
(if (<= t 8.5e-168)
(/ (/ (/ x_m t) -0.5) z)
(if (<= t 13500000.0)
(/ (* x_m 2.0) (* y z))
(/ (/ -2.0 z) (/ t x_m))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -1.08e+20) {
tmp = ((-2.0 / t) * x_m) / z;
} else if (t <= 4e-185) {
tmp = ((x_m * 2.0) / z) / y;
} else if (t <= 8.5e-168) {
tmp = ((x_m / t) / -0.5) / z;
} else if (t <= 13500000.0) {
tmp = (x_m * 2.0) / (y * z);
} else {
tmp = (-2.0 / z) / (t / x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.08d+20)) then
tmp = (((-2.0d0) / t) * x_m) / z
else if (t <= 4d-185) then
tmp = ((x_m * 2.0d0) / z) / y
else if (t <= 8.5d-168) then
tmp = ((x_m / t) / (-0.5d0)) / z
else if (t <= 13500000.0d0) then
tmp = (x_m * 2.0d0) / (y * z)
else
tmp = ((-2.0d0) / z) / (t / x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -1.08e+20) {
tmp = ((-2.0 / t) * x_m) / z;
} else if (t <= 4e-185) {
tmp = ((x_m * 2.0) / z) / y;
} else if (t <= 8.5e-168) {
tmp = ((x_m / t) / -0.5) / z;
} else if (t <= 13500000.0) {
tmp = (x_m * 2.0) / (y * z);
} else {
tmp = (-2.0 / z) / (t / x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -1.08e+20: tmp = ((-2.0 / t) * x_m) / z elif t <= 4e-185: tmp = ((x_m * 2.0) / z) / y elif t <= 8.5e-168: tmp = ((x_m / t) / -0.5) / z elif t <= 13500000.0: tmp = (x_m * 2.0) / (y * z) else: tmp = (-2.0 / z) / (t / x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -1.08e+20) tmp = Float64(Float64(Float64(-2.0 / t) * x_m) / z); elseif (t <= 4e-185) tmp = Float64(Float64(Float64(x_m * 2.0) / z) / y); elseif (t <= 8.5e-168) tmp = Float64(Float64(Float64(x_m / t) / -0.5) / z); elseif (t <= 13500000.0) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z)); else tmp = Float64(Float64(-2.0 / z) / Float64(t / x_m)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (t <= -1.08e+20) tmp = ((-2.0 / t) * x_m) / z; elseif (t <= 4e-185) tmp = ((x_m * 2.0) / z) / y; elseif (t <= 8.5e-168) tmp = ((x_m / t) / -0.5) / z; elseif (t <= 13500000.0) tmp = (x_m * 2.0) / (y * z); else tmp = (-2.0 / z) / (t / x_m); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -1.08e+20], N[(N[(N[(-2.0 / t), $MachinePrecision] * x$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 4e-185], N[(N[(N[(x$95$m * 2.0), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 8.5e-168], N[(N[(N[(x$95$m / t), $MachinePrecision] / -0.5), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 13500000.0], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 / z), $MachinePrecision] / N[(t / x$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.08 \cdot 10^{+20}:\\
\;\;\;\;\frac{\frac{-2}{t} \cdot x\_m}{z}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-185}:\\
\;\;\;\;\frac{\frac{x\_m \cdot 2}{z}}{y}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-168}:\\
\;\;\;\;\frac{\frac{\frac{x\_m}{t}}{-0.5}}{z}\\
\mathbf{elif}\;t \leq 13500000:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-2}{z}}{\frac{t}{x\_m}}\\
\end{array}
\end{array}
if t < -1.08e20Initial program 90.6%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
if -1.08e20 < t < 4e-185Initial program 93.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if 4e-185 < t < 8.4999999999999994e-168Initial program 84.0%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
if 8.4999999999999994e-168 < t < 1.35e7Initial program 98.0%
Taylor expanded in y around inf 0
Simplified0
if 1.35e7 < t Initial program 83.8%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (* (/ -2.0 t) x_m) z)))
(*
x_s
(if (<= t -2.4e+18)
t_1
(if (<= t 4e-185)
(/ (/ (* x_m 2.0) z) y)
(if (<= t 8.5e-168)
t_1
(if (<= t 66000000.0)
(/ (* x_m 2.0) (* y z))
(/ (/ -2.0 z) (/ t x_m)))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = ((-2.0 / t) * x_m) / z;
double tmp;
if (t <= -2.4e+18) {
tmp = t_1;
} else if (t <= 4e-185) {
tmp = ((x_m * 2.0) / z) / y;
} else if (t <= 8.5e-168) {
tmp = t_1;
} else if (t <= 66000000.0) {
tmp = (x_m * 2.0) / (y * z);
} else {
tmp = (-2.0 / z) / (t / x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (((-2.0d0) / t) * x_m) / z
if (t <= (-2.4d+18)) then
tmp = t_1
else if (t <= 4d-185) then
tmp = ((x_m * 2.0d0) / z) / y
else if (t <= 8.5d-168) then
tmp = t_1
else if (t <= 66000000.0d0) then
tmp = (x_m * 2.0d0) / (y * z)
else
tmp = ((-2.0d0) / z) / (t / x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = ((-2.0 / t) * x_m) / z;
double tmp;
if (t <= -2.4e+18) {
tmp = t_1;
} else if (t <= 4e-185) {
tmp = ((x_m * 2.0) / z) / y;
} else if (t <= 8.5e-168) {
tmp = t_1;
} else if (t <= 66000000.0) {
tmp = (x_m * 2.0) / (y * z);
} else {
tmp = (-2.0 / z) / (t / x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = ((-2.0 / t) * x_m) / z tmp = 0 if t <= -2.4e+18: tmp = t_1 elif t <= 4e-185: tmp = ((x_m * 2.0) / z) / y elif t <= 8.5e-168: tmp = t_1 elif t <= 66000000.0: tmp = (x_m * 2.0) / (y * z) else: tmp = (-2.0 / z) / (t / x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(Float64(-2.0 / t) * x_m) / z) tmp = 0.0 if (t <= -2.4e+18) tmp = t_1; elseif (t <= 4e-185) tmp = Float64(Float64(Float64(x_m * 2.0) / z) / y); elseif (t <= 8.5e-168) tmp = t_1; elseif (t <= 66000000.0) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z)); else tmp = Float64(Float64(-2.0 / z) / Float64(t / x_m)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = ((-2.0 / t) * x_m) / z; tmp = 0.0; if (t <= -2.4e+18) tmp = t_1; elseif (t <= 4e-185) tmp = ((x_m * 2.0) / z) / y; elseif (t <= 8.5e-168) tmp = t_1; elseif (t <= 66000000.0) tmp = (x_m * 2.0) / (y * z); else tmp = (-2.0 / z) / (t / x_m); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(-2.0 / t), $MachinePrecision] * x$95$m), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -2.4e+18], t$95$1, If[LessEqual[t, 4e-185], N[(N[(N[(x$95$m * 2.0), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 8.5e-168], t$95$1, If[LessEqual[t, 66000000.0], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 / z), $MachinePrecision] / N[(t / x$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{\frac{-2}{t} \cdot x\_m}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-185}:\\
\;\;\;\;\frac{\frac{x\_m \cdot 2}{z}}{y}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 66000000:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-2}{z}}{\frac{t}{x\_m}}\\
\end{array}
\end{array}
\end{array}
if t < -2.4e18 or 4e-185 < t < 8.4999999999999994e-168Initial program 89.9%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
if -2.4e18 < t < 4e-185Initial program 93.0%
Simplified0
Taylor expanded in y around inf 0
Simplified0
if 8.4999999999999994e-168 < t < 6.6e7Initial program 98.0%
Taylor expanded in y around inf 0
Simplified0
if 6.6e7 < t Initial program 83.8%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (* (/ -2.0 t) x_m) z)))
(*
x_s
(if (<= t -2e+19)
t_1
(if (<= t 4e-185)
(* (/ x_m z) (/ 2.0 y))
(if (<= t 8.5e-168)
t_1
(if (<= t 21000.0)
(/ (* x_m 2.0) (* y z))
(/ (/ -2.0 z) (/ t x_m)))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = ((-2.0 / t) * x_m) / z;
double tmp;
if (t <= -2e+19) {
tmp = t_1;
} else if (t <= 4e-185) {
tmp = (x_m / z) * (2.0 / y);
} else if (t <= 8.5e-168) {
tmp = t_1;
} else if (t <= 21000.0) {
tmp = (x_m * 2.0) / (y * z);
} else {
tmp = (-2.0 / z) / (t / x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (((-2.0d0) / t) * x_m) / z
if (t <= (-2d+19)) then
tmp = t_1
else if (t <= 4d-185) then
tmp = (x_m / z) * (2.0d0 / y)
else if (t <= 8.5d-168) then
tmp = t_1
else if (t <= 21000.0d0) then
tmp = (x_m * 2.0d0) / (y * z)
else
tmp = ((-2.0d0) / z) / (t / x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = ((-2.0 / t) * x_m) / z;
double tmp;
if (t <= -2e+19) {
tmp = t_1;
} else if (t <= 4e-185) {
tmp = (x_m / z) * (2.0 / y);
} else if (t <= 8.5e-168) {
tmp = t_1;
} else if (t <= 21000.0) {
tmp = (x_m * 2.0) / (y * z);
} else {
tmp = (-2.0 / z) / (t / x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = ((-2.0 / t) * x_m) / z tmp = 0 if t <= -2e+19: tmp = t_1 elif t <= 4e-185: tmp = (x_m / z) * (2.0 / y) elif t <= 8.5e-168: tmp = t_1 elif t <= 21000.0: tmp = (x_m * 2.0) / (y * z) else: tmp = (-2.0 / z) / (t / x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(Float64(-2.0 / t) * x_m) / z) tmp = 0.0 if (t <= -2e+19) tmp = t_1; elseif (t <= 4e-185) tmp = Float64(Float64(x_m / z) * Float64(2.0 / y)); elseif (t <= 8.5e-168) tmp = t_1; elseif (t <= 21000.0) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z)); else tmp = Float64(Float64(-2.0 / z) / Float64(t / x_m)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = ((-2.0 / t) * x_m) / z; tmp = 0.0; if (t <= -2e+19) tmp = t_1; elseif (t <= 4e-185) tmp = (x_m / z) * (2.0 / y); elseif (t <= 8.5e-168) tmp = t_1; elseif (t <= 21000.0) tmp = (x_m * 2.0) / (y * z); else tmp = (-2.0 / z) / (t / x_m); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(-2.0 / t), $MachinePrecision] * x$95$m), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -2e+19], t$95$1, If[LessEqual[t, 4e-185], N[(N[(x$95$m / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-168], t$95$1, If[LessEqual[t, 21000.0], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 / z), $MachinePrecision] / N[(t / x$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{\frac{-2}{t} \cdot x\_m}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-185}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{2}{y}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 21000:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-2}{z}}{\frac{t}{x\_m}}\\
\end{array}
\end{array}
\end{array}
if t < -2e19 or 4e-185 < t < 8.4999999999999994e-168Initial program 89.9%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
if -2e19 < t < 4e-185Initial program 93.0%
Taylor expanded in y around inf 0
Simplified0
Applied egg-rr0
if 8.4999999999999994e-168 < t < 21000Initial program 98.0%
Taylor expanded in y around inf 0
Simplified0
if 21000 < t Initial program 83.8%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (* (/ -2.0 t) x_m) z)))
(*
x_s
(if (<= t -2.15e+20)
t_1
(if (<= t 4e-185)
(* (/ x_m z) (/ 2.0 y))
(if (<= t 8.5e-168)
t_1
(if (<= t 215000.0) (/ (* x_m 2.0) (* y z)) t_1)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = ((-2.0 / t) * x_m) / z;
double tmp;
if (t <= -2.15e+20) {
tmp = t_1;
} else if (t <= 4e-185) {
tmp = (x_m / z) * (2.0 / y);
} else if (t <= 8.5e-168) {
tmp = t_1;
} else if (t <= 215000.0) {
tmp = (x_m * 2.0) / (y * z);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (((-2.0d0) / t) * x_m) / z
if (t <= (-2.15d+20)) then
tmp = t_1
else if (t <= 4d-185) then
tmp = (x_m / z) * (2.0d0 / y)
else if (t <= 8.5d-168) then
tmp = t_1
else if (t <= 215000.0d0) then
tmp = (x_m * 2.0d0) / (y * z)
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = ((-2.0 / t) * x_m) / z;
double tmp;
if (t <= -2.15e+20) {
tmp = t_1;
} else if (t <= 4e-185) {
tmp = (x_m / z) * (2.0 / y);
} else if (t <= 8.5e-168) {
tmp = t_1;
} else if (t <= 215000.0) {
tmp = (x_m * 2.0) / (y * z);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = ((-2.0 / t) * x_m) / z tmp = 0 if t <= -2.15e+20: tmp = t_1 elif t <= 4e-185: tmp = (x_m / z) * (2.0 / y) elif t <= 8.5e-168: tmp = t_1 elif t <= 215000.0: tmp = (x_m * 2.0) / (y * z) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(Float64(-2.0 / t) * x_m) / z) tmp = 0.0 if (t <= -2.15e+20) tmp = t_1; elseif (t <= 4e-185) tmp = Float64(Float64(x_m / z) * Float64(2.0 / y)); elseif (t <= 8.5e-168) tmp = t_1; elseif (t <= 215000.0) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z)); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = ((-2.0 / t) * x_m) / z; tmp = 0.0; if (t <= -2.15e+20) tmp = t_1; elseif (t <= 4e-185) tmp = (x_m / z) * (2.0 / y); elseif (t <= 8.5e-168) tmp = t_1; elseif (t <= 215000.0) tmp = (x_m * 2.0) / (y * z); else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(-2.0 / t), $MachinePrecision] * x$95$m), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -2.15e+20], t$95$1, If[LessEqual[t, 4e-185], N[(N[(x$95$m / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-168], t$95$1, If[LessEqual[t, 215000.0], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{\frac{-2}{t} \cdot x\_m}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-185}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{2}{y}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 215000:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -2.15e20 or 4e-185 < t < 8.4999999999999994e-168 or 215000 < t Initial program 86.3%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
if -2.15e20 < t < 4e-185Initial program 93.0%
Taylor expanded in y around inf 0
Simplified0
Applied egg-rr0
if 8.4999999999999994e-168 < t < 215000Initial program 98.0%
Taylor expanded in y around inf 0
Simplified0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -5000000.0)
(/ (* -2.0 x_m) (* t z))
(if (<= t 1200.0) (/ (* x_m 2.0) (* y z)) (* (/ x_m z) (/ -2.0 t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -5000000.0) {
tmp = (-2.0 * x_m) / (t * z);
} else if (t <= 1200.0) {
tmp = (x_m * 2.0) / (y * z);
} else {
tmp = (x_m / z) * (-2.0 / t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5000000.0d0)) then
tmp = ((-2.0d0) * x_m) / (t * z)
else if (t <= 1200.0d0) then
tmp = (x_m * 2.0d0) / (y * z)
else
tmp = (x_m / z) * ((-2.0d0) / t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -5000000.0) {
tmp = (-2.0 * x_m) / (t * z);
} else if (t <= 1200.0) {
tmp = (x_m * 2.0) / (y * z);
} else {
tmp = (x_m / z) * (-2.0 / t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -5000000.0: tmp = (-2.0 * x_m) / (t * z) elif t <= 1200.0: tmp = (x_m * 2.0) / (y * z) else: tmp = (x_m / z) * (-2.0 / t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -5000000.0) tmp = Float64(Float64(-2.0 * x_m) / Float64(t * z)); elseif (t <= 1200.0) tmp = Float64(Float64(x_m * 2.0) / Float64(y * z)); else tmp = Float64(Float64(x_m / z) * Float64(-2.0 / t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (t <= -5000000.0) tmp = (-2.0 * x_m) / (t * z); elseif (t <= 1200.0) tmp = (x_m * 2.0) / (y * z); else tmp = (x_m / z) * (-2.0 / t); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -5000000.0], N[(N[(-2.0 * x$95$m), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1200.0], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -5000000:\\
\;\;\;\;\frac{-2 \cdot x\_m}{t \cdot z}\\
\mathbf{elif}\;t \leq 1200:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -5e6Initial program 89.4%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
if -5e6 < t < 1200Initial program 94.4%
Taylor expanded in y around inf 0
Simplified0
if 1200 < t Initial program 83.8%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -50000000.0)
(/ (* -2.0 x_m) (* t z))
(if (<= t 10500.0) (* (/ (/ 2.0 z) y) x_m) (* (/ x_m z) (/ -2.0 t))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -50000000.0) {
tmp = (-2.0 * x_m) / (t * z);
} else if (t <= 10500.0) {
tmp = ((2.0 / z) / y) * x_m;
} else {
tmp = (x_m / z) * (-2.0 / t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-50000000.0d0)) then
tmp = ((-2.0d0) * x_m) / (t * z)
else if (t <= 10500.0d0) then
tmp = ((2.0d0 / z) / y) * x_m
else
tmp = (x_m / z) * ((-2.0d0) / t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (t <= -50000000.0) {
tmp = (-2.0 * x_m) / (t * z);
} else if (t <= 10500.0) {
tmp = ((2.0 / z) / y) * x_m;
} else {
tmp = (x_m / z) * (-2.0 / t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if t <= -50000000.0: tmp = (-2.0 * x_m) / (t * z) elif t <= 10500.0: tmp = ((2.0 / z) / y) * x_m else: tmp = (x_m / z) * (-2.0 / t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (t <= -50000000.0) tmp = Float64(Float64(-2.0 * x_m) / Float64(t * z)); elseif (t <= 10500.0) tmp = Float64(Float64(Float64(2.0 / z) / y) * x_m); else tmp = Float64(Float64(x_m / z) * Float64(-2.0 / t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (t <= -50000000.0) tmp = (-2.0 * x_m) / (t * z); elseif (t <= 10500.0) tmp = ((2.0 / z) / y) * x_m; else tmp = (x_m / z) * (-2.0 / t); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -50000000.0], N[(N[(-2.0 * x$95$m), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 10500.0], N[(N[(N[(2.0 / z), $MachinePrecision] / y), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -50000000:\\
\;\;\;\;\frac{-2 \cdot x\_m}{t \cdot z}\\
\mathbf{elif}\;t \leq 10500:\\
\;\;\;\;\frac{\frac{2}{z}}{y} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -5e7Initial program 89.4%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
if -5e7 < t < 10500Initial program 94.4%
Taylor expanded in y around inf 0
Simplified0
Applied egg-rr0
if 10500 < t Initial program 83.8%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* (/ x_m z) (/ -2.0 t))))
(*
x_s
(if (<= t -0.9) t_1 (if (<= t 2050000.0) (* (/ (/ 2.0 z) y) x_m) t_1)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) * (-2.0 / t);
double tmp;
if (t <= -0.9) {
tmp = t_1;
} else if (t <= 2050000.0) {
tmp = ((2.0 / z) / y) * x_m;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x_m / z) * ((-2.0d0) / t)
if (t <= (-0.9d0)) then
tmp = t_1
else if (t <= 2050000.0d0) then
tmp = ((2.0d0 / z) / y) * x_m
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) * (-2.0 / t);
double tmp;
if (t <= -0.9) {
tmp = t_1;
} else if (t <= 2050000.0) {
tmp = ((2.0 / z) / y) * x_m;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = (x_m / z) * (-2.0 / t) tmp = 0 if t <= -0.9: tmp = t_1 elif t <= 2050000.0: tmp = ((2.0 / z) / y) * x_m else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / z) * Float64(-2.0 / t)) tmp = 0.0 if (t <= -0.9) tmp = t_1; elseif (t <= 2050000.0) tmp = Float64(Float64(Float64(2.0 / z) / y) * x_m); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = (x_m / z) * (-2.0 / t); tmp = 0.0; if (t <= -0.9) tmp = t_1; elseif (t <= 2050000.0) tmp = ((2.0 / z) / y) * x_m; else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -0.9], t$95$1, If[LessEqual[t, 2050000.0], N[(N[(N[(2.0 / z), $MachinePrecision] / y), $MachinePrecision] * x$95$m), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z} \cdot \frac{-2}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -0.9:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2050000:\\
\;\;\;\;\frac{\frac{2}{z}}{y} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -0.900000000000000022 or 2.05e6 < t Initial program 86.0%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
if -0.900000000000000022 < t < 2.05e6Initial program 94.4%
Taylor expanded in y around inf 0
Simplified0
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* (/ x_m z) (/ -2.0 t))))
(*
x_s
(if (<= t -530000000.0)
t_1
(if (<= t 450000000.0) (* (/ 2.0 (* z y)) x_m) t_1)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) * (-2.0 / t);
double tmp;
if (t <= -530000000.0) {
tmp = t_1;
} else if (t <= 450000000.0) {
tmp = (2.0 / (z * y)) * x_m;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x_m / z) * ((-2.0d0) / t)
if (t <= (-530000000.0d0)) then
tmp = t_1
else if (t <= 450000000.0d0) then
tmp = (2.0d0 / (z * y)) * x_m
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m / z) * (-2.0 / t);
double tmp;
if (t <= -530000000.0) {
tmp = t_1;
} else if (t <= 450000000.0) {
tmp = (2.0 / (z * y)) * x_m;
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = (x_m / z) * (-2.0 / t) tmp = 0 if t <= -530000000.0: tmp = t_1 elif t <= 450000000.0: tmp = (2.0 / (z * y)) * x_m else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m / z) * Float64(-2.0 / t)) tmp = 0.0 if (t <= -530000000.0) tmp = t_1; elseif (t <= 450000000.0) tmp = Float64(Float64(2.0 / Float64(z * y)) * x_m); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = (x_m / z) * (-2.0 / t); tmp = 0.0; if (t <= -530000000.0) tmp = t_1; elseif (t <= 450000000.0) tmp = (2.0 / (z * y)) * x_m; else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -530000000.0], t$95$1, If[LessEqual[t, 450000000.0], N[(N[(2.0 / N[(z * y), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z} \cdot \frac{-2}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -530000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 450000000:\\
\;\;\;\;\frac{2}{z \cdot y} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -5.3e8 or 4.5e8 < t Initial program 86.0%
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
if -5.3e8 < t < 4.5e8Initial program 94.4%
Taylor expanded in y around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= (* x_m 2.0) 4e-54)
(* (/ -2.0 (* z (- t y))) x_m)
(/ (/ 2.0 z) (/ (- y t) x_m)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 4e-54) {
tmp = (-2.0 / (z * (t - y))) * x_m;
} else {
tmp = (2.0 / z) / ((y - t) / x_m);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x_m * 2.0d0) <= 4d-54) then
tmp = ((-2.0d0) / (z * (t - y))) * x_m
else
tmp = (2.0d0 / z) / ((y - t) / x_m)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 4e-54) {
tmp = (-2.0 / (z * (t - y))) * x_m;
} else {
tmp = (2.0 / z) / ((y - t) / x_m);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (x_m * 2.0) <= 4e-54: tmp = (-2.0 / (z * (t - y))) * x_m else: tmp = (2.0 / z) / ((y - t) / x_m) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (Float64(x_m * 2.0) <= 4e-54) tmp = Float64(Float64(-2.0 / Float64(z * Float64(t - y))) * x_m); else tmp = Float64(Float64(2.0 / z) / Float64(Float64(y - t) / x_m)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((x_m * 2.0) <= 4e-54) tmp = (-2.0 / (z * (t - y))) * x_m; else tmp = (2.0 / z) / ((y - t) / x_m); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[N[(x$95$m * 2.0), $MachinePrecision], 4e-54], N[(N[(-2.0 / N[(z * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] / N[(N[(y - t), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \cdot 2 \leq 4 \cdot 10^{-54}:\\
\;\;\;\;\frac{-2}{z \cdot \left(t - y\right)} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{z}}{\frac{y - t}{x\_m}}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 4.0000000000000001e-54Initial program 92.2%
Applied egg-rr0
if 4.0000000000000001e-54 < (*.f64 x #s(literal 2 binary64)) Initial program 84.9%
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= (* x_m 2.0) 1e-46)
(* (/ -2.0 (* z (- t y))) x_m)
(/ (* (/ -2.0 (- t y)) x_m) z))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 1e-46) {
tmp = (-2.0 / (z * (t - y))) * x_m;
} else {
tmp = ((-2.0 / (t - y)) * x_m) / z;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x_m * 2.0d0) <= 1d-46) then
tmp = ((-2.0d0) / (z * (t - y))) * x_m
else
tmp = (((-2.0d0) / (t - y)) * x_m) / z
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 1e-46) {
tmp = (-2.0 / (z * (t - y))) * x_m;
} else {
tmp = ((-2.0 / (t - y)) * x_m) / z;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (x_m * 2.0) <= 1e-46: tmp = (-2.0 / (z * (t - y))) * x_m else: tmp = ((-2.0 / (t - y)) * x_m) / z return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (Float64(x_m * 2.0) <= 1e-46) tmp = Float64(Float64(-2.0 / Float64(z * Float64(t - y))) * x_m); else tmp = Float64(Float64(Float64(-2.0 / Float64(t - y)) * x_m) / z); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((x_m * 2.0) <= 1e-46) tmp = (-2.0 / (z * (t - y))) * x_m; else tmp = ((-2.0 / (t - y)) * x_m) / z; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[N[(x$95$m * 2.0), $MachinePrecision], 1e-46], N[(N[(-2.0 / N[(z * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(N[(-2.0 / N[(t - y), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \cdot 2 \leq 10^{-46}:\\
\;\;\;\;\frac{-2}{z \cdot \left(t - y\right)} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-2}{t - y} \cdot x\_m}{z}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 1.00000000000000002e-46Initial program 92.3%
Applied egg-rr0
if 1.00000000000000002e-46 < (*.f64 x #s(literal 2 binary64)) Initial program 84.5%
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= (* x_m 2.0) 5e-86)
(* (/ -2.0 (* z (- t y))) x_m)
(* (/ x_m (- y t)) (/ 2.0 z)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 5e-86) {
tmp = (-2.0 / (z * (t - y))) * x_m;
} else {
tmp = (x_m / (y - t)) * (2.0 / z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x_m * 2.0d0) <= 5d-86) then
tmp = ((-2.0d0) / (z * (t - y))) * x_m
else
tmp = (x_m / (y - t)) * (2.0d0 / z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 5e-86) {
tmp = (-2.0 / (z * (t - y))) * x_m;
} else {
tmp = (x_m / (y - t)) * (2.0 / z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (x_m * 2.0) <= 5e-86: tmp = (-2.0 / (z * (t - y))) * x_m else: tmp = (x_m / (y - t)) * (2.0 / z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (Float64(x_m * 2.0) <= 5e-86) tmp = Float64(Float64(-2.0 / Float64(z * Float64(t - y))) * x_m); else tmp = Float64(Float64(x_m / Float64(y - t)) * Float64(2.0 / z)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((x_m * 2.0) <= 5e-86) tmp = (-2.0 / (z * (t - y))) * x_m; else tmp = (x_m / (y - t)) * (2.0 / z); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[N[(x$95$m * 2.0), $MachinePrecision], 5e-86], N[(N[(-2.0 / N[(z * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(x$95$m / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \cdot 2 \leq 5 \cdot 10^{-86}:\\
\;\;\;\;\frac{-2}{z \cdot \left(t - y\right)} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 4.9999999999999999e-86Initial program 91.9%
Applied egg-rr0
if 4.9999999999999999e-86 < (*.f64 x #s(literal 2 binary64)) Initial program 86.3%
Applied egg-rr0
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z 7.5e-21)
(* (/ -2.0 (* z (- t y))) x_m)
(* (/ x_m z) (/ -2.0 (- t y))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= 7.5e-21) {
tmp = (-2.0 / (z * (t - y))) * x_m;
} else {
tmp = (x_m / z) * (-2.0 / (t - y));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 7.5d-21) then
tmp = ((-2.0d0) / (z * (t - y))) * x_m
else
tmp = (x_m / z) * ((-2.0d0) / (t - y))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= 7.5e-21) {
tmp = (-2.0 / (z * (t - y))) * x_m;
} else {
tmp = (x_m / z) * (-2.0 / (t - y));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= 7.5e-21: tmp = (-2.0 / (z * (t - y))) * x_m else: tmp = (x_m / z) * (-2.0 / (t - y)) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= 7.5e-21) tmp = Float64(Float64(-2.0 / Float64(z * Float64(t - y))) * x_m); else tmp = Float64(Float64(x_m / z) * Float64(-2.0 / Float64(t - y))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= 7.5e-21) tmp = (-2.0 / (z * (t - y))) * x_m; else tmp = (x_m / z) * (-2.0 / (t - y)); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, 7.5e-21], N[(N[(-2.0 / N[(z * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * N[(-2.0 / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 7.5 \cdot 10^{-21}:\\
\;\;\;\;\frac{-2}{z \cdot \left(t - y\right)} \cdot x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{-2}{t - y}\\
\end{array}
\end{array}
if z < 7.50000000000000072e-21Initial program 90.0%
Applied egg-rr0
if 7.50000000000000072e-21 < z Initial program 90.1%
Applied egg-rr0
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* (/ -2.0 (* z (- t y))) x_m)))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((-2.0 / (z * (t - y))) * x_m);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * (((-2.0d0) / (z * (t - y))) * x_m)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((-2.0 / (z * (t - y))) * x_m);
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * ((-2.0 / (z * (t - y))) * x_m)
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(Float64(-2.0 / Float64(z * Float64(t - y))) * x_m)) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * ((-2.0 / (z * (t - y))) * x_m); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(N[(-2.0 / N[(z * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \left(\frac{-2}{z \cdot \left(t - y\right)} \cdot x\_m\right)
\end{array}
Initial program 90.0%
Applied egg-rr0
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* (/ 2.0 (* z y)) x_m)))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((2.0 / (z * y)) * x_m);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * ((2.0d0 / (z * y)) * x_m)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * ((2.0 / (z * y)) * x_m);
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * ((2.0 / (z * y)) * x_m)
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(Float64(2.0 / Float64(z * y)) * x_m)) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * ((2.0 / (z * y)) * x_m); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(N[(2.0 / N[(z * y), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \left(\frac{2}{z \cdot y} \cdot x\_m\right)
\end{array}
Initial program 90.0%
Taylor expanded in y around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
(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 2024110
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:alt
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))