
(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 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= (* x_m 2.0) 2e-69)
(/ (/ 2.0 (- y t)) (/ z x_m))
(/ 2.0 (/ z (/ x_m (- y 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 ((x_m * 2.0) <= 2e-69) {
tmp = (2.0 / (y - t)) / (z / x_m);
} else {
tmp = 2.0 / (z / (x_m / (y - 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 ((x_m * 2.0d0) <= 2d-69) then
tmp = (2.0d0 / (y - t)) / (z / x_m)
else
tmp = 2.0d0 / (z / (x_m / (y - 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 ((x_m * 2.0) <= 2e-69) {
tmp = (2.0 / (y - t)) / (z / x_m);
} else {
tmp = 2.0 / (z / (x_m / (y - 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 (x_m * 2.0) <= 2e-69: tmp = (2.0 / (y - t)) / (z / x_m) else: tmp = 2.0 / (z / (x_m / (y - 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 (Float64(x_m * 2.0) <= 2e-69) tmp = Float64(Float64(2.0 / Float64(y - t)) / Float64(z / x_m)); else tmp = Float64(2.0 / Float64(z / Float64(x_m / Float64(y - 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 ((x_m * 2.0) <= 2e-69) tmp = (2.0 / (y - t)) / (z / x_m); else tmp = 2.0 / (z / (x_m / (y - 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[N[(x$95$m * 2.0), $MachinePrecision], 2e-69], N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(z / N[(x$95$m / N[(y - t), $MachinePrecision]), $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}\;x_m \cdot 2 \leq 2 \cdot 10^{-69}:\\
\;\;\;\;\frac{\frac{2}{y - t}}{\frac{z}{x_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{z}{\frac{x_m}{y - t}}}\\
\end{array}
\end{array}
if (*.f64 x 2) < 1.9999999999999999e-69Initial program 90.0%
*-commutative90.0%
associate-*l/89.3%
*-commutative89.3%
distribute-rgt-out--91.1%
associate-/l/91.8%
Simplified91.8%
associate-*r/89.7%
associate-*l/93.6%
*-commutative93.6%
clear-num93.5%
un-div-inv94.0%
Applied egg-rr94.0%
if 1.9999999999999999e-69 < (*.f64 x 2) Initial program 85.5%
*-commutative85.5%
associate-*l/85.3%
*-commutative85.3%
distribute-rgt-out--86.6%
associate-/l/88.6%
Simplified88.6%
associate-*r/97.2%
associate-*l/89.2%
clear-num89.1%
frac-times89.0%
metadata-eval89.0%
Applied egg-rr89.0%
associate-*l/86.6%
associate-/l*96.9%
Applied egg-rr96.9%
Final simplification94.9%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -1.6e-37)
(* -2.0 (/ x_m (* t z)))
(if (<= t -2.9e-275)
(* (/ x_m y) (/ 2.0 z))
(if (<= t 2.55e-26) (* x_m (/ (/ 2.0 y) z)) (* -2.0 (/ (/ x_m t) 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 (t <= -1.6e-37) {
tmp = -2.0 * (x_m / (t * z));
} else if (t <= -2.9e-275) {
tmp = (x_m / y) * (2.0 / z);
} else if (t <= 2.55e-26) {
tmp = x_m * ((2.0 / y) / z);
} else {
tmp = -2.0 * ((x_m / t) / 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 (t <= (-1.6d-37)) then
tmp = (-2.0d0) * (x_m / (t * z))
else if (t <= (-2.9d-275)) then
tmp = (x_m / y) * (2.0d0 / z)
else if (t <= 2.55d-26) then
tmp = x_m * ((2.0d0 / y) / z)
else
tmp = (-2.0d0) * ((x_m / t) / 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 (t <= -1.6e-37) {
tmp = -2.0 * (x_m / (t * z));
} else if (t <= -2.9e-275) {
tmp = (x_m / y) * (2.0 / z);
} else if (t <= 2.55e-26) {
tmp = x_m * ((2.0 / y) / z);
} else {
tmp = -2.0 * ((x_m / t) / 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 t <= -1.6e-37: tmp = -2.0 * (x_m / (t * z)) elif t <= -2.9e-275: tmp = (x_m / y) * (2.0 / z) elif t <= 2.55e-26: tmp = x_m * ((2.0 / y) / z) else: tmp = -2.0 * ((x_m / t) / 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 (t <= -1.6e-37) tmp = Float64(-2.0 * Float64(x_m / Float64(t * z))); elseif (t <= -2.9e-275) tmp = Float64(Float64(x_m / y) * Float64(2.0 / z)); elseif (t <= 2.55e-26) tmp = Float64(x_m * Float64(Float64(2.0 / y) / z)); else tmp = Float64(-2.0 * Float64(Float64(x_m / t) / 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 (t <= -1.6e-37) tmp = -2.0 * (x_m / (t * z)); elseif (t <= -2.9e-275) tmp = (x_m / y) * (2.0 / z); elseif (t <= 2.55e-26) tmp = x_m * ((2.0 / y) / z); else tmp = -2.0 * ((x_m / t) / 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[t, -1.6e-37], N[(-2.0 * N[(x$95$m / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.9e-275], N[(N[(x$95$m / y), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-26], N[(x$95$m * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / t), $MachinePrecision] / 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}\;t \leq -1.6 \cdot 10^{-37}:\\
\;\;\;\;-2 \cdot \frac{x_m}{t \cdot z}\\
\mathbf{elif}\;t \leq -2.9 \cdot 10^{-275}:\\
\;\;\;\;\frac{x_m}{y} \cdot \frac{2}{z}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-26}:\\
\;\;\;\;x_m \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x_m}{t}}{z}\\
\end{array}
\end{array}
if t < -1.5999999999999999e-37Initial program 88.7%
*-commutative88.7%
associate-*l/87.3%
*-commutative87.3%
distribute-rgt-out--89.9%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in y around 0 78.2%
*-commutative78.2%
Simplified78.2%
if -1.5999999999999999e-37 < t < -2.9e-275Initial program 83.2%
distribute-rgt-out--83.3%
Simplified83.3%
Taylor expanded in y around inf 63.7%
*-commutative63.7%
Simplified63.7%
*-commutative63.7%
times-frac77.6%
Applied egg-rr77.6%
if -2.9e-275 < t < 2.54999999999999995e-26Initial program 91.8%
*-commutative91.8%
associate-*l/91.7%
*-commutative91.7%
distribute-rgt-out--91.8%
associate-/l/93.1%
Simplified93.1%
Taylor expanded in y around inf 81.0%
associate-/r*82.4%
Simplified82.4%
if 2.54999999999999995e-26 < t Initial program 88.0%
*-commutative88.0%
associate-*l/87.8%
*-commutative87.8%
distribute-rgt-out--90.9%
associate-/l/92.7%
Simplified92.7%
Taylor expanded in y around 0 72.0%
associate-/r*76.3%
Simplified76.3%
Final simplification78.8%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* (/ x_m z) (/ -2.0 t))))
(*
x_s
(if (<= t -8.5e-39)
t_1
(if (<= t -4.7e-271)
(* (/ x_m y) (/ 2.0 z))
(if (<= t 2.8e-26) (* 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 = (x_m / z) * (-2.0 / t);
double tmp;
if (t <= -8.5e-39) {
tmp = t_1;
} else if (t <= -4.7e-271) {
tmp = (x_m / y) * (2.0 / z);
} else if (t <= 2.8e-26) {
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 = (x_m / z) * ((-2.0d0) / t)
if (t <= (-8.5d-39)) then
tmp = t_1
else if (t <= (-4.7d-271)) then
tmp = (x_m / y) * (2.0d0 / z)
else if (t <= 2.8d-26) 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 = (x_m / z) * (-2.0 / t);
double tmp;
if (t <= -8.5e-39) {
tmp = t_1;
} else if (t <= -4.7e-271) {
tmp = (x_m / y) * (2.0 / z);
} else if (t <= 2.8e-26) {
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 = (x_m / z) * (-2.0 / t) tmp = 0 if t <= -8.5e-39: tmp = t_1 elif t <= -4.7e-271: tmp = (x_m / y) * (2.0 / z) elif t <= 2.8e-26: 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(x_m / z) * Float64(-2.0 / t)) tmp = 0.0 if (t <= -8.5e-39) tmp = t_1; elseif (t <= -4.7e-271) tmp = Float64(Float64(x_m / y) * Float64(2.0 / z)); elseif (t <= 2.8e-26) tmp = Float64(x_m * Float64(Float64(2.0 / 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 = (x_m / z) * (-2.0 / t); tmp = 0.0; if (t <= -8.5e-39) tmp = t_1; elseif (t <= -4.7e-271) tmp = (x_m / y) * (2.0 / z); elseif (t <= 2.8e-26) 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[(x$95$m / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -8.5e-39], t$95$1, If[LessEqual[t, -4.7e-271], N[(N[(x$95$m / y), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e-26], N[(x$95$m * N[(N[(2.0 / y), $MachinePrecision] / 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{x_m}{z} \cdot \frac{-2}{t}\\
x_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-271}:\\
\;\;\;\;\frac{x_m}{y} \cdot \frac{2}{z}\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-26}:\\
\;\;\;\;x_m \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
\end{array}
if t < -8.5000000000000005e-39 or 2.8000000000000001e-26 < t Initial program 88.4%
distribute-rgt-out--91.2%
times-frac92.5%
Simplified92.5%
Taylor expanded in y around 0 77.4%
if -8.5000000000000005e-39 < t < -4.70000000000000005e-271Initial program 83.2%
distribute-rgt-out--83.3%
Simplified83.3%
Taylor expanded in y around inf 63.7%
*-commutative63.7%
Simplified63.7%
*-commutative63.7%
times-frac77.6%
Applied egg-rr77.6%
if -4.70000000000000005e-271 < t < 2.8000000000000001e-26Initial program 91.8%
*-commutative91.8%
associate-*l/91.7%
*-commutative91.7%
distribute-rgt-out--91.8%
associate-/l/93.1%
Simplified93.1%
Taylor expanded in y around inf 81.0%
associate-/r*82.4%
Simplified82.4%
Final simplification78.9%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -1.35e-39)
(/ -2.0 (* t (/ z x_m)))
(if (<= t -3.45e-270)
(* (/ x_m y) (/ 2.0 z))
(if (<= t 3.8e-27) (* 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 <= -1.35e-39) {
tmp = -2.0 / (t * (z / x_m));
} else if (t <= -3.45e-270) {
tmp = (x_m / y) * (2.0 / z);
} else if (t <= 3.8e-27) {
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 <= (-1.35d-39)) then
tmp = (-2.0d0) / (t * (z / x_m))
else if (t <= (-3.45d-270)) then
tmp = (x_m / y) * (2.0d0 / z)
else if (t <= 3.8d-27) 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 <= -1.35e-39) {
tmp = -2.0 / (t * (z / x_m));
} else if (t <= -3.45e-270) {
tmp = (x_m / y) * (2.0 / z);
} else if (t <= 3.8e-27) {
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 <= -1.35e-39: tmp = -2.0 / (t * (z / x_m)) elif t <= -3.45e-270: tmp = (x_m / y) * (2.0 / z) elif t <= 3.8e-27: 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 <= -1.35e-39) tmp = Float64(-2.0 / Float64(t * Float64(z / x_m))); elseif (t <= -3.45e-270) tmp = Float64(Float64(x_m / y) * Float64(2.0 / z)); elseif (t <= 3.8e-27) tmp = Float64(x_m * Float64(Float64(2.0 / 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 <= -1.35e-39) tmp = -2.0 / (t * (z / x_m)); elseif (t <= -3.45e-270) tmp = (x_m / y) * (2.0 / z); elseif (t <= 3.8e-27) 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, -1.35e-39], N[(-2.0 / N[(t * N[(z / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.45e-270], N[(N[(x$95$m / y), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e-27], N[(x$95$m * N[(N[(2.0 / y), $MachinePrecision] / 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 -1.35 \cdot 10^{-39}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x_m}}\\
\mathbf{elif}\;t \leq -3.45 \cdot 10^{-270}:\\
\;\;\;\;\frac{x_m}{y} \cdot \frac{2}{z}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-27}:\\
\;\;\;\;x_m \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x_m}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -1.35e-39Initial program 88.7%
*-commutative88.7%
associate-*l/87.3%
*-commutative87.3%
distribute-rgt-out--89.9%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in y around 0 77.1%
associate-*r/75.9%
associate-*l/78.4%
clear-num78.4%
frac-times79.1%
metadata-eval79.1%
Applied egg-rr79.1%
if -1.35e-39 < t < -3.45000000000000021e-270Initial program 83.2%
distribute-rgt-out--83.3%
Simplified83.3%
Taylor expanded in y around inf 63.7%
*-commutative63.7%
Simplified63.7%
*-commutative63.7%
times-frac77.6%
Applied egg-rr77.6%
if -3.45000000000000021e-270 < t < 3.8e-27Initial program 91.8%
*-commutative91.8%
associate-*l/91.7%
*-commutative91.7%
distribute-rgt-out--91.8%
associate-/l/93.1%
Simplified93.1%
Taylor expanded in y around inf 81.0%
associate-/r*82.4%
Simplified82.4%
if 3.8e-27 < t Initial program 88.0%
distribute-rgt-out--91.0%
times-frac88.1%
Simplified88.1%
Taylor expanded in y around 0 76.3%
Final simplification79.1%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -1.8e-37)
(* -2.0 (/ x_m (* t z)))
(if (<= t 4.5e-27) (* x_m (/ 2.0 (* y z))) (* -2.0 (/ (/ x_m t) 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 (t <= -1.8e-37) {
tmp = -2.0 * (x_m / (t * z));
} else if (t <= 4.5e-27) {
tmp = x_m * (2.0 / (y * z));
} else {
tmp = -2.0 * ((x_m / t) / 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 (t <= (-1.8d-37)) then
tmp = (-2.0d0) * (x_m / (t * z))
else if (t <= 4.5d-27) then
tmp = x_m * (2.0d0 / (y * z))
else
tmp = (-2.0d0) * ((x_m / t) / 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 (t <= -1.8e-37) {
tmp = -2.0 * (x_m / (t * z));
} else if (t <= 4.5e-27) {
tmp = x_m * (2.0 / (y * z));
} else {
tmp = -2.0 * ((x_m / t) / 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 t <= -1.8e-37: tmp = -2.0 * (x_m / (t * z)) elif t <= 4.5e-27: tmp = x_m * (2.0 / (y * z)) else: tmp = -2.0 * ((x_m / t) / 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 (t <= -1.8e-37) tmp = Float64(-2.0 * Float64(x_m / Float64(t * z))); elseif (t <= 4.5e-27) tmp = Float64(x_m * Float64(2.0 / Float64(y * z))); else tmp = Float64(-2.0 * Float64(Float64(x_m / t) / 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 (t <= -1.8e-37) tmp = -2.0 * (x_m / (t * z)); elseif (t <= 4.5e-27) tmp = x_m * (2.0 / (y * z)); else tmp = -2.0 * ((x_m / t) / 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[t, -1.8e-37], N[(-2.0 * N[(x$95$m / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-27], N[(x$95$m * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / t), $MachinePrecision] / 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}\;t \leq -1.8 \cdot 10^{-37}:\\
\;\;\;\;-2 \cdot \frac{x_m}{t \cdot z}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-27}:\\
\;\;\;\;x_m \cdot \frac{2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x_m}{t}}{z}\\
\end{array}
\end{array}
if t < -1.80000000000000004e-37Initial program 88.7%
*-commutative88.7%
associate-*l/87.3%
*-commutative87.3%
distribute-rgt-out--89.9%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in y around 0 78.2%
*-commutative78.2%
Simplified78.2%
if -1.80000000000000004e-37 < t < 4.5000000000000002e-27Initial program 88.8%
*-commutative88.8%
associate-*l/88.7%
*-commutative88.7%
distribute-rgt-out--88.8%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in y around inf 74.9%
*-commutative74.9%
Simplified74.9%
if 4.5000000000000002e-27 < t Initial program 88.0%
*-commutative88.0%
associate-*l/87.8%
*-commutative87.8%
distribute-rgt-out--90.9%
associate-/l/92.7%
Simplified92.7%
Taylor expanded in y around 0 72.0%
associate-/r*76.3%
Simplified76.3%
Final simplification76.3%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -7e-40)
(* -2.0 (/ x_m (* t z)))
(if (<= t 2.45e-27) (* x_m (/ (/ 2.0 y) z)) (* -2.0 (/ (/ x_m t) 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 (t <= -7e-40) {
tmp = -2.0 * (x_m / (t * z));
} else if (t <= 2.45e-27) {
tmp = x_m * ((2.0 / y) / z);
} else {
tmp = -2.0 * ((x_m / t) / 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 (t <= (-7d-40)) then
tmp = (-2.0d0) * (x_m / (t * z))
else if (t <= 2.45d-27) then
tmp = x_m * ((2.0d0 / y) / z)
else
tmp = (-2.0d0) * ((x_m / t) / 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 (t <= -7e-40) {
tmp = -2.0 * (x_m / (t * z));
} else if (t <= 2.45e-27) {
tmp = x_m * ((2.0 / y) / z);
} else {
tmp = -2.0 * ((x_m / t) / 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 t <= -7e-40: tmp = -2.0 * (x_m / (t * z)) elif t <= 2.45e-27: tmp = x_m * ((2.0 / y) / z) else: tmp = -2.0 * ((x_m / t) / 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 (t <= -7e-40) tmp = Float64(-2.0 * Float64(x_m / Float64(t * z))); elseif (t <= 2.45e-27) tmp = Float64(x_m * Float64(Float64(2.0 / y) / z)); else tmp = Float64(-2.0 * Float64(Float64(x_m / t) / 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 (t <= -7e-40) tmp = -2.0 * (x_m / (t * z)); elseif (t <= 2.45e-27) tmp = x_m * ((2.0 / y) / z); else tmp = -2.0 * ((x_m / t) / 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[t, -7e-40], N[(-2.0 * N[(x$95$m / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.45e-27], N[(x$95$m * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / t), $MachinePrecision] / 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}\;t \leq -7 \cdot 10^{-40}:\\
\;\;\;\;-2 \cdot \frac{x_m}{t \cdot z}\\
\mathbf{elif}\;t \leq 2.45 \cdot 10^{-27}:\\
\;\;\;\;x_m \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x_m}{t}}{z}\\
\end{array}
\end{array}
if t < -7.0000000000000003e-40Initial program 88.7%
*-commutative88.7%
associate-*l/87.3%
*-commutative87.3%
distribute-rgt-out--89.9%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in y around 0 78.2%
*-commutative78.2%
Simplified78.2%
if -7.0000000000000003e-40 < t < 2.44999999999999988e-27Initial program 88.8%
*-commutative88.8%
associate-*l/88.7%
*-commutative88.7%
distribute-rgt-out--88.8%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in y around inf 74.9%
associate-/r*76.3%
Simplified76.3%
if 2.44999999999999988e-27 < t Initial program 88.0%
*-commutative88.0%
associate-*l/87.8%
*-commutative87.8%
distribute-rgt-out--90.9%
associate-/l/92.7%
Simplified92.7%
Taylor expanded in y around 0 72.0%
associate-/r*76.3%
Simplified76.3%
Final simplification76.9%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -3.5e-40)
(/ -2.0 (* t (/ z x_m)))
(if (<= t 1.8e-26) (/ 2.0 (* y (/ z 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 <= -3.5e-40) {
tmp = -2.0 / (t * (z / x_m));
} else if (t <= 1.8e-26) {
tmp = 2.0 / (y * (z / 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 <= (-3.5d-40)) then
tmp = (-2.0d0) / (t * (z / x_m))
else if (t <= 1.8d-26) then
tmp = 2.0d0 / (y * (z / 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 <= -3.5e-40) {
tmp = -2.0 / (t * (z / x_m));
} else if (t <= 1.8e-26) {
tmp = 2.0 / (y * (z / 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 <= -3.5e-40: tmp = -2.0 / (t * (z / x_m)) elif t <= 1.8e-26: tmp = 2.0 / (y * (z / 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 <= -3.5e-40) tmp = Float64(-2.0 / Float64(t * Float64(z / x_m))); elseif (t <= 1.8e-26) tmp = Float64(2.0 / Float64(y * Float64(z / 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 <= -3.5e-40) tmp = -2.0 / (t * (z / x_m)); elseif (t <= 1.8e-26) tmp = 2.0 / (y * (z / 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, -3.5e-40], N[(-2.0 / N[(t * N[(z / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e-26], N[(2.0 / N[(y * N[(z / x$95$m), $MachinePrecision]), $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 -3.5 \cdot 10^{-40}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x_m}}\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-26}:\\
\;\;\;\;\frac{2}{y \cdot \frac{z}{x_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x_m}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -3.5000000000000002e-40Initial program 88.7%
*-commutative88.7%
associate-*l/87.3%
*-commutative87.3%
distribute-rgt-out--89.9%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in y around 0 77.1%
associate-*r/75.9%
associate-*l/78.4%
clear-num78.4%
frac-times79.1%
metadata-eval79.1%
Applied egg-rr79.1%
if -3.5000000000000002e-40 < t < 1.8000000000000001e-26Initial program 88.8%
*-commutative88.8%
associate-*l/88.7%
*-commutative88.7%
distribute-rgt-out--88.8%
associate-/l/90.1%
Simplified90.1%
associate-*r/92.3%
associate-*l/91.8%
clear-num91.7%
frac-times91.2%
metadata-eval91.2%
Applied egg-rr91.2%
Taylor expanded in y around inf 75.0%
associate-*r/79.8%
Simplified79.8%
if 1.8000000000000001e-26 < t Initial program 88.0%
distribute-rgt-out--91.0%
times-frac88.1%
Simplified88.1%
Taylor expanded in y around 0 76.3%
Final simplification78.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -6.8e-41)
(/ (/ -2.0 t) (/ z x_m))
(if (<= t 4.9e-27) (/ 2.0 (* y (/ z 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 <= -6.8e-41) {
tmp = (-2.0 / t) / (z / x_m);
} else if (t <= 4.9e-27) {
tmp = 2.0 / (y * (z / 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 <= (-6.8d-41)) then
tmp = ((-2.0d0) / t) / (z / x_m)
else if (t <= 4.9d-27) then
tmp = 2.0d0 / (y * (z / 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 <= -6.8e-41) {
tmp = (-2.0 / t) / (z / x_m);
} else if (t <= 4.9e-27) {
tmp = 2.0 / (y * (z / 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 <= -6.8e-41: tmp = (-2.0 / t) / (z / x_m) elif t <= 4.9e-27: tmp = 2.0 / (y * (z / 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 <= -6.8e-41) tmp = Float64(Float64(-2.0 / t) / Float64(z / x_m)); elseif (t <= 4.9e-27) tmp = Float64(2.0 / Float64(y * Float64(z / 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 <= -6.8e-41) tmp = (-2.0 / t) / (z / x_m); elseif (t <= 4.9e-27) tmp = 2.0 / (y * (z / 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, -6.8e-41], N[(N[(-2.0 / t), $MachinePrecision] / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.9e-27], N[(2.0 / N[(y * N[(z / x$95$m), $MachinePrecision]), $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 -6.8 \cdot 10^{-41}:\\
\;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x_m}}\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-27}:\\
\;\;\;\;\frac{2}{y \cdot \frac{z}{x_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x_m}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -6.7999999999999997e-41Initial program 88.7%
*-commutative88.7%
associate-*l/87.3%
*-commutative87.3%
distribute-rgt-out--89.9%
associate-/l/90.1%
Simplified90.1%
associate-*r/91.4%
associate-*l/96.2%
*-commutative96.2%
clear-num96.1%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in y around 0 79.4%
if -6.7999999999999997e-41 < t < 4.89999999999999976e-27Initial program 88.8%
*-commutative88.8%
associate-*l/88.7%
*-commutative88.7%
distribute-rgt-out--88.8%
associate-/l/90.1%
Simplified90.1%
associate-*r/92.3%
associate-*l/91.8%
clear-num91.7%
frac-times91.2%
metadata-eval91.2%
Applied egg-rr91.2%
Taylor expanded in y around inf 75.0%
associate-*r/79.8%
Simplified79.8%
if 4.89999999999999976e-27 < t Initial program 88.0%
distribute-rgt-out--91.0%
times-frac88.1%
Simplified88.1%
Taylor expanded in y around 0 76.3%
Final simplification78.8%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -1.4e-37)
(/ (/ -2.0 t) (/ z x_m))
(if (<= t 3.8e-26) (/ (/ x_m z) (* y 0.5)) (* (/ 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 <= -1.4e-37) {
tmp = (-2.0 / t) / (z / x_m);
} else if (t <= 3.8e-26) {
tmp = (x_m / z) / (y * 0.5);
} 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 <= (-1.4d-37)) then
tmp = ((-2.0d0) / t) / (z / x_m)
else if (t <= 3.8d-26) then
tmp = (x_m / z) / (y * 0.5d0)
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 <= -1.4e-37) {
tmp = (-2.0 / t) / (z / x_m);
} else if (t <= 3.8e-26) {
tmp = (x_m / z) / (y * 0.5);
} 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 <= -1.4e-37: tmp = (-2.0 / t) / (z / x_m) elif t <= 3.8e-26: tmp = (x_m / z) / (y * 0.5) 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 <= -1.4e-37) tmp = Float64(Float64(-2.0 / t) / Float64(z / x_m)); elseif (t <= 3.8e-26) tmp = Float64(Float64(x_m / z) / Float64(y * 0.5)); 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 <= -1.4e-37) tmp = (-2.0 / t) / (z / x_m); elseif (t <= 3.8e-26) tmp = (x_m / z) / (y * 0.5); 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, -1.4e-37], N[(N[(-2.0 / t), $MachinePrecision] / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e-26], N[(N[(x$95$m / z), $MachinePrecision] / N[(y * 0.5), $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 -1.4 \cdot 10^{-37}:\\
\;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x_m}}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-26}:\\
\;\;\;\;\frac{\frac{x_m}{z}}{y \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{x_m}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -1.4000000000000001e-37Initial program 88.7%
*-commutative88.7%
associate-*l/87.3%
*-commutative87.3%
distribute-rgt-out--89.9%
associate-/l/90.1%
Simplified90.1%
associate-*r/91.4%
associate-*l/96.2%
*-commutative96.2%
clear-num96.1%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in y around 0 79.4%
if -1.4000000000000001e-37 < t < 3.80000000000000015e-26Initial program 88.8%
*-commutative88.8%
associate-*l/88.7%
*-commutative88.7%
distribute-rgt-out--88.8%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in y around inf 74.9%
*-commutative74.9%
Simplified74.9%
associate-*r/75.0%
times-frac80.5%
clear-num80.5%
un-div-inv80.7%
div-inv80.7%
metadata-eval80.7%
Applied egg-rr80.7%
if 3.80000000000000015e-26 < t Initial program 88.0%
distribute-rgt-out--91.0%
times-frac88.1%
Simplified88.1%
Taylor expanded in y around 0 76.3%
Final simplification79.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= t -9e-38)
(/ (/ -2.0 t) (/ z x_m))
(if (<= t 6.4e-27) (/ (/ x_m z) (* y 0.5)) (/ (/ (* x_m -2.0) t) 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 (t <= -9e-38) {
tmp = (-2.0 / t) / (z / x_m);
} else if (t <= 6.4e-27) {
tmp = (x_m / z) / (y * 0.5);
} else {
tmp = ((x_m * -2.0) / t) / 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 (t <= (-9d-38)) then
tmp = ((-2.0d0) / t) / (z / x_m)
else if (t <= 6.4d-27) then
tmp = (x_m / z) / (y * 0.5d0)
else
tmp = ((x_m * (-2.0d0)) / t) / 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 (t <= -9e-38) {
tmp = (-2.0 / t) / (z / x_m);
} else if (t <= 6.4e-27) {
tmp = (x_m / z) / (y * 0.5);
} else {
tmp = ((x_m * -2.0) / t) / 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 t <= -9e-38: tmp = (-2.0 / t) / (z / x_m) elif t <= 6.4e-27: tmp = (x_m / z) / (y * 0.5) else: tmp = ((x_m * -2.0) / t) / 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 (t <= -9e-38) tmp = Float64(Float64(-2.0 / t) / Float64(z / x_m)); elseif (t <= 6.4e-27) tmp = Float64(Float64(x_m / z) / Float64(y * 0.5)); else tmp = Float64(Float64(Float64(x_m * -2.0) / t) / 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 (t <= -9e-38) tmp = (-2.0 / t) / (z / x_m); elseif (t <= 6.4e-27) tmp = (x_m / z) / (y * 0.5); else tmp = ((x_m * -2.0) / t) / 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[t, -9e-38], N[(N[(-2.0 / t), $MachinePrecision] / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.4e-27], N[(N[(x$95$m / z), $MachinePrecision] / N[(y * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$95$m * -2.0), $MachinePrecision] / t), $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}\;t \leq -9 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x_m}}\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-27}:\\
\;\;\;\;\frac{\frac{x_m}{z}}{y \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x_m \cdot -2}{t}}{z}\\
\end{array}
\end{array}
if t < -9.00000000000000018e-38Initial program 88.7%
*-commutative88.7%
associate-*l/87.3%
*-commutative87.3%
distribute-rgt-out--89.9%
associate-/l/90.1%
Simplified90.1%
associate-*r/91.4%
associate-*l/96.2%
*-commutative96.2%
clear-num96.1%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in y around 0 79.4%
if -9.00000000000000018e-38 < t < 6.39999999999999982e-27Initial program 88.8%
*-commutative88.8%
associate-*l/88.7%
*-commutative88.7%
distribute-rgt-out--88.8%
associate-/l/90.1%
Simplified90.1%
Taylor expanded in y around inf 74.9%
*-commutative74.9%
Simplified74.9%
associate-*r/75.0%
times-frac80.5%
clear-num80.5%
un-div-inv80.7%
div-inv80.7%
metadata-eval80.7%
Applied egg-rr80.7%
if 6.39999999999999982e-27 < t Initial program 88.0%
*-commutative88.0%
associate-*l/87.8%
*-commutative87.8%
distribute-rgt-out--90.9%
associate-/l/92.7%
Simplified92.7%
Taylor expanded in y around 0 72.0%
*-commutative72.0%
Simplified72.0%
associate-*r/72.0%
metadata-eval72.0%
distribute-lft-neg-in72.0%
*-commutative72.0%
*-commutative72.0%
associate-/r*76.3%
distribute-rgt-neg-in76.3%
metadata-eval76.3%
Applied egg-rr76.3%
Final simplification79.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= (* x_m 2.0) 2e-69)
(* (/ 2.0 (- y t)) (/ x_m z))
(/ 2.0 (/ z (/ x_m (- y 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 ((x_m * 2.0) <= 2e-69) {
tmp = (2.0 / (y - t)) * (x_m / z);
} else {
tmp = 2.0 / (z / (x_m / (y - 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 ((x_m * 2.0d0) <= 2d-69) then
tmp = (2.0d0 / (y - t)) * (x_m / z)
else
tmp = 2.0d0 / (z / (x_m / (y - 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 ((x_m * 2.0) <= 2e-69) {
tmp = (2.0 / (y - t)) * (x_m / z);
} else {
tmp = 2.0 / (z / (x_m / (y - 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 (x_m * 2.0) <= 2e-69: tmp = (2.0 / (y - t)) * (x_m / z) else: tmp = 2.0 / (z / (x_m / (y - 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 (Float64(x_m * 2.0) <= 2e-69) tmp = Float64(Float64(2.0 / Float64(y - t)) * Float64(x_m / z)); else tmp = Float64(2.0 / Float64(z / Float64(x_m / Float64(y - 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 ((x_m * 2.0) <= 2e-69) tmp = (2.0 / (y - t)) * (x_m / z); else tmp = 2.0 / (z / (x_m / (y - 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[N[(x$95$m * 2.0), $MachinePrecision], 2e-69], N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(z / N[(x$95$m / N[(y - t), $MachinePrecision]), $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}\;x_m \cdot 2 \leq 2 \cdot 10^{-69}:\\
\;\;\;\;\frac{2}{y - t} \cdot \frac{x_m}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{z}{\frac{x_m}{y - t}}}\\
\end{array}
\end{array}
if (*.f64 x 2) < 1.9999999999999999e-69Initial program 90.0%
distribute-rgt-out--91.8%
times-frac93.6%
Simplified93.6%
if 1.9999999999999999e-69 < (*.f64 x 2) Initial program 85.5%
*-commutative85.5%
associate-*l/85.3%
*-commutative85.3%
distribute-rgt-out--86.6%
associate-/l/88.6%
Simplified88.6%
associate-*r/97.2%
associate-*l/89.2%
clear-num89.1%
frac-times89.0%
metadata-eval89.0%
Applied egg-rr89.0%
associate-*l/86.6%
associate-/l*96.9%
Applied egg-rr96.9%
Final simplification94.6%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (/ 2.0 (- y t)))) (* x_s (if (<= z 7e+30) (* x_m (/ t_1 z)) (* t_1 (/ 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 t_1 = 2.0 / (y - t);
double tmp;
if (z <= 7e+30) {
tmp = x_m * (t_1 / z);
} else {
tmp = t_1 * (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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 / (y - t)
if (z <= 7d+30) then
tmp = x_m * (t_1 / z)
else
tmp = t_1 * (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 t_1 = 2.0 / (y - t);
double tmp;
if (z <= 7e+30) {
tmp = x_m * (t_1 / z);
} else {
tmp = t_1 * (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): t_1 = 2.0 / (y - t) tmp = 0 if z <= 7e+30: tmp = x_m * (t_1 / z) else: tmp = t_1 * (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) t_1 = Float64(2.0 / Float64(y - t)) tmp = 0.0 if (z <= 7e+30) tmp = Float64(x_m * Float64(t_1 / z)); else tmp = Float64(t_1 * Float64(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) t_1 = 2.0 / (y - t); tmp = 0.0; if (z <= 7e+30) tmp = x_m * (t_1 / z); else tmp = t_1 * (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_] := Block[{t$95$1 = N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, 7e+30], N[(x$95$m * N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(x$95$m / z), $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{2}{y - t}\\
x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 7 \cdot 10^{+30}:\\
\;\;\;\;x_m \cdot \frac{t_1}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{x_m}{z}\\
\end{array}
\end{array}
\end{array}
if z < 7.00000000000000042e30Initial program 90.9%
*-commutative90.9%
associate-*l/90.3%
*-commutative90.3%
distribute-rgt-out--91.3%
associate-/l/92.1%
Simplified92.1%
if 7.00000000000000042e30 < z Initial program 80.9%
distribute-rgt-out--84.2%
times-frac96.1%
Simplified96.1%
Final simplification93.1%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= x_m 1.2e+64) (* -2.0 (/ x_m (* t z))) (* -2.0 (/ (/ x_m t) 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 <= 1.2e+64) {
tmp = -2.0 * (x_m / (t * z));
} else {
tmp = -2.0 * ((x_m / t) / 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 <= 1.2d+64) then
tmp = (-2.0d0) * (x_m / (t * z))
else
tmp = (-2.0d0) * ((x_m / t) / 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 <= 1.2e+64) {
tmp = -2.0 * (x_m / (t * z));
} else {
tmp = -2.0 * ((x_m / t) / 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 <= 1.2e+64: tmp = -2.0 * (x_m / (t * z)) else: tmp = -2.0 * ((x_m / t) / 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 (x_m <= 1.2e+64) tmp = Float64(-2.0 * Float64(x_m / Float64(t * z))); else tmp = Float64(-2.0 * Float64(Float64(x_m / t) / 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 <= 1.2e+64) tmp = -2.0 * (x_m / (t * z)); else tmp = -2.0 * ((x_m / t) / 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[x$95$m, 1.2e+64], N[(-2.0 * N[(x$95$m / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / t), $MachinePrecision] / 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 \leq 1.2 \cdot 10^{+64}:\\
\;\;\;\;-2 \cdot \frac{x_m}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x_m}{t}}{z}\\
\end{array}
\end{array}
if x < 1.2e64Initial program 91.2%
*-commutative91.2%
associate-*l/90.6%
*-commutative90.6%
distribute-rgt-out--92.2%
associate-/l/92.8%
Simplified92.8%
Taylor expanded in y around 0 53.9%
*-commutative53.9%
Simplified53.9%
if 1.2e64 < x Initial program 78.7%
*-commutative78.7%
associate-*l/78.6%
*-commutative78.6%
distribute-rgt-out--80.5%
associate-/l/83.3%
Simplified83.3%
Taylor expanded in y around 0 38.8%
associate-/r*48.8%
Simplified48.8%
Final simplification52.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* x_m (/ (/ 2.0 (- y t)) 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) {
return x_s * (x_m * ((2.0 / (y - t)) / z));
}
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 * (x_m * ((2.0d0 / (y - t)) / z))
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 * (x_m * ((2.0 / (y - t)) / z));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * (x_m * ((2.0 / (y - t)) / z))
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(x_m * Float64(Float64(2.0 / Float64(y - t)) / z))) 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 * (x_m * ((2.0 / (y - t)) / z)); 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[(x$95$m * N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x_s \cdot \left(x_m \cdot \frac{\frac{2}{y - t}}{z}\right)
\end{array}
Initial program 88.6%
*-commutative88.6%
associate-*l/88.1%
*-commutative88.1%
distribute-rgt-out--89.7%
associate-/l/90.8%
Simplified90.8%
Final simplification90.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* -2.0 (/ x_m (* t 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) {
return x_s * (-2.0 * (x_m / (t * z)));
}
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) * (x_m / (t * z)))
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 * (x_m / (t * z)));
}
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 * (x_m / (t * z)))
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(-2.0 * Float64(x_m / Float64(t * z)))) 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 * (x_m / (t * z))); 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[(-2.0 * N[(x$95$m / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x_s \cdot \left(-2 \cdot \frac{x_m}{t \cdot z}\right)
\end{array}
Initial program 88.6%
*-commutative88.6%
associate-*l/88.1%
*-commutative88.1%
distribute-rgt-out--89.7%
associate-/l/90.8%
Simplified90.8%
Taylor expanded in y around 0 50.6%
*-commutative50.6%
Simplified50.6%
Final simplification50.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 2024018
(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))))