
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - 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 * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - 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 * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ t (- 1.0 z))))
(*
x_s
(if (<= x_m 1.5e-12)
(- (* (/ x_m z) y) (* x_m t_1))
(* x_m (- (/ 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 = t / (1.0 - z);
double tmp;
if (x_m <= 1.5e-12) {
tmp = ((x_m / z) * y) - (x_m * t_1);
} else {
tmp = x_m * ((y / z) - 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 = t / (1.0d0 - z)
if (x_m <= 1.5d-12) then
tmp = ((x_m / z) * y) - (x_m * t_1)
else
tmp = x_m * ((y / z) - 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 = t / (1.0 - z);
double tmp;
if (x_m <= 1.5e-12) {
tmp = ((x_m / z) * y) - (x_m * t_1);
} else {
tmp = x_m * ((y / z) - 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 = t / (1.0 - z) tmp = 0 if x_m <= 1.5e-12: tmp = ((x_m / z) * y) - (x_m * t_1) else: tmp = x_m * ((y / z) - 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(t / Float64(1.0 - z)) tmp = 0.0 if (x_m <= 1.5e-12) tmp = Float64(Float64(Float64(x_m / z) * y) - Float64(x_m * t_1)); else tmp = Float64(x_m * Float64(Float64(y / z) - 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 = t / (1.0 - z); tmp = 0.0; if (x_m <= 1.5e-12) tmp = ((x_m / z) * y) - (x_m * t_1); else tmp = x_m * ((y / z) - 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[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[x$95$m, 1.5e-12], N[(N[(N[(x$95$m / z), $MachinePrecision] * y), $MachinePrecision] - N[(x$95$m * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(y / z), $MachinePrecision] - t$95$1), $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{t}{1 - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 1.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{x\_m}{z} \cdot y - x\_m \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - t\_1\right)\\
\end{array}
\end{array}
\end{array}
if x < 1.5000000000000001e-12Initial program 94.2%
clear-num94.2%
associate-/r/94.2%
Applied egg-rr94.2%
Taylor expanded in y around 0 88.5%
+-commutative88.5%
mul-1-neg88.5%
associate-/l*89.6%
unsub-neg89.6%
associate-/l*89.7%
associate-/r/92.8%
associate-/r/94.5%
*-commutative94.5%
Simplified94.5%
if 1.5000000000000001e-12 < x Initial program 99.7%
Final simplification96.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 (<= z -1.85e+23)
(* x_m (/ y z))
(if (<= z 620000000.0)
(* x_m (- (/ y z) t))
(if (<= z 1.02e+59)
(/ x_m (/ z t))
(if (<= z 1.75e+105) (* (/ x_m z) y) (* 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 (z <= -1.85e+23) {
tmp = x_m * (y / z);
} else if (z <= 620000000.0) {
tmp = x_m * ((y / z) - t);
} else if (z <= 1.02e+59) {
tmp = x_m / (z / t);
} else if (z <= 1.75e+105) {
tmp = (x_m / z) * y;
} else {
tmp = 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 (z <= (-1.85d+23)) then
tmp = x_m * (y / z)
else if (z <= 620000000.0d0) then
tmp = x_m * ((y / z) - t)
else if (z <= 1.02d+59) then
tmp = x_m / (z / t)
else if (z <= 1.75d+105) then
tmp = (x_m / z) * y
else
tmp = 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 (z <= -1.85e+23) {
tmp = x_m * (y / z);
} else if (z <= 620000000.0) {
tmp = x_m * ((y / z) - t);
} else if (z <= 1.02e+59) {
tmp = x_m / (z / t);
} else if (z <= 1.75e+105) {
tmp = (x_m / z) * y;
} else {
tmp = 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 z <= -1.85e+23: tmp = x_m * (y / z) elif z <= 620000000.0: tmp = x_m * ((y / z) - t) elif z <= 1.02e+59: tmp = x_m / (z / t) elif z <= 1.75e+105: tmp = (x_m / z) * y else: tmp = 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 (z <= -1.85e+23) tmp = Float64(x_m * Float64(y / z)); elseif (z <= 620000000.0) tmp = Float64(x_m * Float64(Float64(y / z) - t)); elseif (z <= 1.02e+59) tmp = Float64(x_m / Float64(z / t)); elseif (z <= 1.75e+105) tmp = Float64(Float64(x_m / z) * y); else tmp = Float64(x_m * Float64(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 (z <= -1.85e+23) tmp = x_m * (y / z); elseif (z <= 620000000.0) tmp = x_m * ((y / z) - t); elseif (z <= 1.02e+59) tmp = x_m / (z / t); elseif (z <= 1.75e+105) tmp = (x_m / z) * y; else tmp = 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[z, -1.85e+23], N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 620000000.0], N[(x$95$m * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+59], N[(x$95$m / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+105], N[(N[(x$95$m / z), $MachinePrecision] * y), $MachinePrecision], N[(x$95$m * N[(t / 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}\;z \leq -1.85 \cdot 10^{+23}:\\
\;\;\;\;x\_m \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 620000000:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+59}:\\
\;\;\;\;\frac{x\_m}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+105}:\\
\;\;\;\;\frac{x\_m}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{t}{z}\\
\end{array}
\end{array}
if z < -1.85000000000000006e23Initial program 97.5%
Taylor expanded in y around inf 63.2%
associate-*r/69.0%
Simplified69.0%
if -1.85000000000000006e23 < z < 6.2e8Initial program 94.1%
Taylor expanded in z around 0 91.6%
+-commutative91.6%
associate-*r/88.5%
*-commutative88.5%
associate-*r*88.5%
neg-mul-188.5%
distribute-rgt-out92.5%
unsub-neg92.5%
Simplified92.5%
if 6.2e8 < z < 1.02000000000000002e59Initial program 100.0%
clear-num100.0%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 95.2%
associate-/l*95.4%
sub-neg95.4%
mul-1-neg95.4%
remove-double-neg95.4%
Simplified95.4%
Taylor expanded in y around 0 80.1%
if 1.02000000000000002e59 < z < 1.74999999999999996e105Initial program 99.9%
Taylor expanded in y around inf 76.0%
associate-/l*83.6%
associate-/r/84.1%
Simplified84.1%
if 1.74999999999999996e105 < z Initial program 98.3%
clear-num98.2%
associate-/r/98.2%
Applied egg-rr98.2%
Taylor expanded in z around inf 81.8%
associate-/l*98.2%
sub-neg98.2%
mul-1-neg98.2%
remove-double-neg98.2%
Simplified98.2%
Taylor expanded in y around 0 61.0%
*-commutative61.0%
associate-*r/70.8%
Simplified70.8%
Final simplification83.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 (<= z -5.2e+34)
(* x_m (/ y z))
(if (<= z 920000000.0)
(* x_m (- (/ y z) t))
(if (<= z 2.3e+58)
(* x_m (/ t (+ z -1.0)))
(if (<= z 3.8e+105) (* (/ x_m z) y) (* 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 (z <= -5.2e+34) {
tmp = x_m * (y / z);
} else if (z <= 920000000.0) {
tmp = x_m * ((y / z) - t);
} else if (z <= 2.3e+58) {
tmp = x_m * (t / (z + -1.0));
} else if (z <= 3.8e+105) {
tmp = (x_m / z) * y;
} else {
tmp = 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 (z <= (-5.2d+34)) then
tmp = x_m * (y / z)
else if (z <= 920000000.0d0) then
tmp = x_m * ((y / z) - t)
else if (z <= 2.3d+58) then
tmp = x_m * (t / (z + (-1.0d0)))
else if (z <= 3.8d+105) then
tmp = (x_m / z) * y
else
tmp = 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 (z <= -5.2e+34) {
tmp = x_m * (y / z);
} else if (z <= 920000000.0) {
tmp = x_m * ((y / z) - t);
} else if (z <= 2.3e+58) {
tmp = x_m * (t / (z + -1.0));
} else if (z <= 3.8e+105) {
tmp = (x_m / z) * y;
} else {
tmp = 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 z <= -5.2e+34: tmp = x_m * (y / z) elif z <= 920000000.0: tmp = x_m * ((y / z) - t) elif z <= 2.3e+58: tmp = x_m * (t / (z + -1.0)) elif z <= 3.8e+105: tmp = (x_m / z) * y else: tmp = 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 (z <= -5.2e+34) tmp = Float64(x_m * Float64(y / z)); elseif (z <= 920000000.0) tmp = Float64(x_m * Float64(Float64(y / z) - t)); elseif (z <= 2.3e+58) tmp = Float64(x_m * Float64(t / Float64(z + -1.0))); elseif (z <= 3.8e+105) tmp = Float64(Float64(x_m / z) * y); else tmp = Float64(x_m * Float64(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 (z <= -5.2e+34) tmp = x_m * (y / z); elseif (z <= 920000000.0) tmp = x_m * ((y / z) - t); elseif (z <= 2.3e+58) tmp = x_m * (t / (z + -1.0)); elseif (z <= 3.8e+105) tmp = (x_m / z) * y; else tmp = 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[z, -5.2e+34], N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 920000000.0], N[(x$95$m * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+58], N[(x$95$m * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+105], N[(N[(x$95$m / z), $MachinePrecision] * y), $MachinePrecision], N[(x$95$m * N[(t / 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}\;z \leq -5.2 \cdot 10^{+34}:\\
\;\;\;\;x\_m \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 920000000:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+58}:\\
\;\;\;\;x\_m \cdot \frac{t}{z + -1}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+105}:\\
\;\;\;\;\frac{x\_m}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{t}{z}\\
\end{array}
\end{array}
if z < -5.19999999999999995e34Initial program 97.5%
Taylor expanded in y around inf 63.2%
associate-*r/69.0%
Simplified69.0%
if -5.19999999999999995e34 < z < 9.2e8Initial program 94.1%
Taylor expanded in z around 0 91.6%
+-commutative91.6%
associate-*r/88.5%
*-commutative88.5%
associate-*r*88.5%
neg-mul-188.5%
distribute-rgt-out92.5%
unsub-neg92.5%
Simplified92.5%
if 9.2e8 < z < 2.30000000000000002e58Initial program 100.0%
Taylor expanded in y around 0 84.4%
associate-*r/84.4%
associate-*r*84.4%
neg-mul-184.4%
associate-*l/84.7%
*-commutative84.7%
distribute-frac-neg84.7%
mul-1-neg84.7%
*-commutative84.7%
associate-*l/84.7%
associate-*r/84.4%
metadata-eval84.4%
associate-/r*84.4%
neg-mul-184.4%
associate-*r/84.7%
*-rgt-identity84.7%
neg-sub084.7%
associate--r-84.7%
metadata-eval84.7%
Simplified84.7%
if 2.30000000000000002e58 < z < 3.8e105Initial program 99.9%
Taylor expanded in y around inf 76.0%
associate-/l*83.6%
associate-/r/84.1%
Simplified84.1%
if 3.8e105 < z Initial program 98.3%
clear-num98.2%
associate-/r/98.2%
Applied egg-rr98.2%
Taylor expanded in z around inf 81.8%
associate-/l*98.2%
sub-neg98.2%
mul-1-neg98.2%
remove-double-neg98.2%
Simplified98.2%
Taylor expanded in y around 0 61.0%
*-commutative61.0%
associate-*r/70.8%
Simplified70.8%
Final simplification84.0%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (- (/ y z) (/ t (- 1.0 z))))) (* x_s (if (<= t_1 5e+306) (* x_m t_1) (* (/ x_m z) 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 t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= 5e+306) {
tmp = x_m * t_1;
} else {
tmp = (x_m / z) * 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) :: t_1
real(8) :: tmp
t_1 = (y / z) - (t / (1.0d0 - z))
if (t_1 <= 5d+306) then
tmp = x_m * t_1
else
tmp = (x_m / z) * 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 t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= 5e+306) {
tmp = x_m * t_1;
} else {
tmp = (x_m / z) * 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): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= 5e+306: tmp = x_m * t_1 else: tmp = (x_m / z) * y 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(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if (t_1 <= 5e+306) tmp = Float64(x_m * t_1); else tmp = Float64(Float64(x_m / z) * 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) t_1 = (y / z) - (t / (1.0 - z)); tmp = 0.0; if (t_1 <= 5e+306) tmp = x_m * t_1; else tmp = (x_m / z) * 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_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, 5e+306], N[(x$95$m * t$95$1), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * y), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;x\_m \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot y\\
\end{array}
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 4.99999999999999993e306Initial program 97.5%
if 4.99999999999999993e306 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 79.6%
Taylor expanded in y around inf 99.9%
associate-/l*80.3%
associate-/r/99.9%
Simplified99.9%
Final simplification97.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 (or (<= z -9.0) (not (<= z 0.0005)))
(* x_m (/ (+ y t) z))
(* x_m (- (/ y z) 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 ((z <= -9.0) || !(z <= 0.0005)) {
tmp = x_m * ((y + t) / z);
} else {
tmp = x_m * ((y / z) - 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 ((z <= (-9.0d0)) .or. (.not. (z <= 0.0005d0))) then
tmp = x_m * ((y + t) / z)
else
tmp = x_m * ((y / z) - 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 ((z <= -9.0) || !(z <= 0.0005)) {
tmp = x_m * ((y + t) / z);
} else {
tmp = x_m * ((y / z) - 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 (z <= -9.0) or not (z <= 0.0005): tmp = x_m * ((y + t) / z) else: tmp = x_m * ((y / z) - 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 ((z <= -9.0) || !(z <= 0.0005)) tmp = Float64(x_m * Float64(Float64(y + t) / z)); else tmp = Float64(x_m * Float64(Float64(y / z) - 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 ((z <= -9.0) || ~((z <= 0.0005))) tmp = x_m * ((y + t) / z); else tmp = x_m * ((y / z) - 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[Or[LessEqual[z, -9.0], N[Not[LessEqual[z, 0.0005]], $MachinePrecision]], N[(x$95$m * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(y / z), $MachinePrecision] - 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}\;z \leq -9 \lor \neg \left(z \leq 0.0005\right):\\
\;\;\;\;x\_m \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -9 or 5.0000000000000001e-4 < z Initial program 98.4%
clear-num98.4%
associate-/r/98.3%
Applied egg-rr98.3%
Taylor expanded in z around inf 97.6%
sub-neg97.6%
mul-1-neg97.6%
remove-double-neg97.6%
Simplified97.6%
if -9 < z < 5.0000000000000001e-4Initial program 93.6%
Taylor expanded in z around 0 92.8%
+-commutative92.8%
associate-*r/89.4%
*-commutative89.4%
associate-*r*89.4%
neg-mul-189.4%
distribute-rgt-out93.1%
unsub-neg93.1%
Simplified93.1%
Final simplification95.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 (<= z -9.0)
(/ x_m (/ z (+ y t)))
(if (<= z 0.0005) (* x_m (- (/ y z) t)) (* x_m (/ (+ 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) {
double tmp;
if (z <= -9.0) {
tmp = x_m / (z / (y + t));
} else if (z <= 0.0005) {
tmp = x_m * ((y / z) - t);
} else {
tmp = x_m * ((y + 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 (z <= (-9.0d0)) then
tmp = x_m / (z / (y + t))
else if (z <= 0.0005d0) then
tmp = x_m * ((y / z) - t)
else
tmp = x_m * ((y + 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 (z <= -9.0) {
tmp = x_m / (z / (y + t));
} else if (z <= 0.0005) {
tmp = x_m * ((y / z) - t);
} else {
tmp = x_m * ((y + 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 z <= -9.0: tmp = x_m / (z / (y + t)) elif z <= 0.0005: tmp = x_m * ((y / z) - t) else: tmp = x_m * ((y + 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 (z <= -9.0) tmp = Float64(x_m / Float64(z / Float64(y + t))); elseif (z <= 0.0005) tmp = Float64(x_m * Float64(Float64(y / z) - t)); else tmp = Float64(x_m * Float64(Float64(y + 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 (z <= -9.0) tmp = x_m / (z / (y + t)); elseif (z <= 0.0005) tmp = x_m * ((y / z) - t); else tmp = x_m * ((y + 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[z, -9.0], N[(x$95$m / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0005], N[(x$95$m * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(y + 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}\;z \leq -9:\\
\;\;\;\;\frac{x\_m}{\frac{z}{y + t}}\\
\mathbf{elif}\;z \leq 0.0005:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{y + t}{z}\\
\end{array}
\end{array}
if z < -9Initial program 97.8%
Taylor expanded in z around inf 88.1%
associate-/l*96.6%
cancel-sign-sub-inv96.6%
metadata-eval96.6%
*-lft-identity96.6%
+-commutative96.6%
Simplified96.6%
if -9 < z < 5.0000000000000001e-4Initial program 93.6%
Taylor expanded in z around 0 92.8%
+-commutative92.8%
associate-*r/89.4%
*-commutative89.4%
associate-*r*89.4%
neg-mul-189.4%
distribute-rgt-out93.1%
unsub-neg93.1%
Simplified93.1%
if 5.0000000000000001e-4 < z Initial program 98.9%
clear-num98.8%
associate-/r/98.8%
Applied egg-rr98.8%
Taylor expanded in z around inf 98.5%
sub-neg98.5%
mul-1-neg98.5%
remove-double-neg98.5%
Simplified98.5%
Final simplification95.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 (or (<= z -0.022) (not (<= z 22500.0))) (* x_m (/ t z)) (* x_m (- 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 ((z <= -0.022) || !(z <= 22500.0)) {
tmp = x_m * (t / z);
} else {
tmp = x_m * -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 ((z <= (-0.022d0)) .or. (.not. (z <= 22500.0d0))) then
tmp = x_m * (t / z)
else
tmp = x_m * -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 ((z <= -0.022) || !(z <= 22500.0)) {
tmp = x_m * (t / z);
} else {
tmp = x_m * -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 (z <= -0.022) or not (z <= 22500.0): tmp = x_m * (t / z) else: tmp = x_m * -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 ((z <= -0.022) || !(z <= 22500.0)) tmp = Float64(x_m * Float64(t / z)); else tmp = Float64(x_m * Float64(-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 ((z <= -0.022) || ~((z <= 22500.0))) tmp = x_m * (t / z); else tmp = x_m * -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[Or[LessEqual[z, -0.022], N[Not[LessEqual[z, 22500.0]], $MachinePrecision]], N[(x$95$m * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * (-t)), $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 -0.022 \lor \neg \left(z \leq 22500\right):\\
\;\;\;\;x\_m \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -0.021999999999999999 or 22500 < z Initial program 98.3%
clear-num98.3%
associate-/r/98.3%
Applied egg-rr98.3%
Taylor expanded in z around inf 86.9%
associate-/l*97.5%
sub-neg97.5%
mul-1-neg97.5%
remove-double-neg97.5%
Simplified97.5%
Taylor expanded in y around 0 51.8%
*-commutative51.8%
associate-*r/56.1%
Simplified56.1%
if -0.021999999999999999 < z < 22500Initial program 93.7%
Taylor expanded in z around 0 93.0%
+-commutative93.0%
associate-*r/89.7%
*-commutative89.7%
associate-*r*89.7%
neg-mul-189.7%
distribute-rgt-out93.3%
unsub-neg93.3%
Simplified93.3%
Taylor expanded in y around 0 31.7%
associate-*r*31.7%
mul-1-neg31.7%
Simplified31.7%
Final simplification42.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 (or (<= y -1.5e-129) (not (<= y 3.3e-47)))
(* (/ x_m z) y)
(* 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 ((y <= -1.5e-129) || !(y <= 3.3e-47)) {
tmp = (x_m / z) * y;
} else {
tmp = 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 ((y <= (-1.5d-129)) .or. (.not. (y <= 3.3d-47))) then
tmp = (x_m / z) * y
else
tmp = 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 ((y <= -1.5e-129) || !(y <= 3.3e-47)) {
tmp = (x_m / z) * y;
} else {
tmp = 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 (y <= -1.5e-129) or not (y <= 3.3e-47): tmp = (x_m / z) * y else: tmp = 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 ((y <= -1.5e-129) || !(y <= 3.3e-47)) tmp = Float64(Float64(x_m / z) * y); else tmp = Float64(x_m * Float64(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 ((y <= -1.5e-129) || ~((y <= 3.3e-47))) tmp = (x_m / z) * y; else tmp = 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[Or[LessEqual[y, -1.5e-129], N[Not[LessEqual[y, 3.3e-47]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * y), $MachinePrecision], N[(x$95$m * N[(t / 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}\;y \leq -1.5 \cdot 10^{-129} \lor \neg \left(y \leq 3.3 \cdot 10^{-47}\right):\\
\;\;\;\;\frac{x\_m}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{t}{z}\\
\end{array}
\end{array}
if y < -1.4999999999999999e-129 or 3.30000000000000004e-47 < y Initial program 94.8%
Taylor expanded in y around inf 76.0%
associate-/l*76.1%
associate-/r/78.8%
Simplified78.8%
if -1.4999999999999999e-129 < y < 3.30000000000000004e-47Initial program 97.9%
clear-num97.8%
associate-/r/97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 63.2%
associate-/l*63.5%
sub-neg63.5%
mul-1-neg63.5%
remove-double-neg63.5%
Simplified63.5%
Taylor expanded in y around 0 54.1%
*-commutative54.1%
associate-*r/55.5%
Simplified55.5%
Final simplification70.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 (or (<= y -1.25e-129) (not (<= y 3.2e-47)))
(* (/ x_m z) y)
(/ x_m (/ z 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 ((y <= -1.25e-129) || !(y <= 3.2e-47)) {
tmp = (x_m / z) * y;
} else {
tmp = x_m / (z / 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 ((y <= (-1.25d-129)) .or. (.not. (y <= 3.2d-47))) then
tmp = (x_m / z) * y
else
tmp = x_m / (z / 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 ((y <= -1.25e-129) || !(y <= 3.2e-47)) {
tmp = (x_m / z) * y;
} else {
tmp = x_m / (z / 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 (y <= -1.25e-129) or not (y <= 3.2e-47): tmp = (x_m / z) * y else: tmp = x_m / (z / 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 ((y <= -1.25e-129) || !(y <= 3.2e-47)) tmp = Float64(Float64(x_m / z) * y); else tmp = Float64(x_m / Float64(z / 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 ((y <= -1.25e-129) || ~((y <= 3.2e-47))) tmp = (x_m / z) * y; else tmp = x_m / (z / 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[Or[LessEqual[y, -1.25e-129], N[Not[LessEqual[y, 3.2e-47]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * y), $MachinePrecision], N[(x$95$m / N[(z / 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}\;y \leq -1.25 \cdot 10^{-129} \lor \neg \left(y \leq 3.2 \cdot 10^{-47}\right):\\
\;\;\;\;\frac{x\_m}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\frac{z}{t}}\\
\end{array}
\end{array}
if y < -1.25000000000000007e-129 or 3.1999999999999999e-47 < y Initial program 94.8%
Taylor expanded in y around inf 76.0%
associate-/l*76.1%
associate-/r/78.8%
Simplified78.8%
if -1.25000000000000007e-129 < y < 3.1999999999999999e-47Initial program 97.9%
clear-num97.8%
associate-/r/97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 63.2%
associate-/l*63.5%
sub-neg63.5%
mul-1-neg63.5%
remove-double-neg63.5%
Simplified63.5%
Taylor expanded in y around 0 55.6%
Final simplification70.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.9e+193)
(* x_m (- t))
(if (<= t 1e+79) (* x_m (/ y z)) (* 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.9e+193) {
tmp = x_m * -t;
} else if (t <= 1e+79) {
tmp = x_m * (y / z);
} else {
tmp = 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.9d+193)) then
tmp = x_m * -t
else if (t <= 1d+79) then
tmp = x_m * (y / z)
else
tmp = 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.9e+193) {
tmp = x_m * -t;
} else if (t <= 1e+79) {
tmp = x_m * (y / z);
} else {
tmp = 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.9e+193: tmp = x_m * -t elif t <= 1e+79: tmp = x_m * (y / z) else: tmp = 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.9e+193) tmp = Float64(x_m * Float64(-t)); elseif (t <= 1e+79) tmp = Float64(x_m * Float64(y / z)); else tmp = Float64(x_m * Float64(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.9e+193) tmp = x_m * -t; elseif (t <= 1e+79) tmp = x_m * (y / z); else tmp = 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.9e+193], N[(x$95$m * (-t)), $MachinePrecision], If[LessEqual[t, 1e+79], N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(t / 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.9 \cdot 10^{+193}:\\
\;\;\;\;x\_m \cdot \left(-t\right)\\
\mathbf{elif}\;t \leq 10^{+79}:\\
\;\;\;\;x\_m \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -1.89999999999999986e193Initial program 99.8%
Taylor expanded in z around 0 60.3%
+-commutative60.3%
associate-*r/60.4%
*-commutative60.4%
associate-*r*60.4%
neg-mul-160.4%
distribute-rgt-out63.9%
unsub-neg63.9%
Simplified63.9%
Taylor expanded in y around 0 53.5%
associate-*r*53.5%
mul-1-neg53.5%
Simplified53.5%
if -1.89999999999999986e193 < t < 9.99999999999999967e78Initial program 95.0%
Taylor expanded in y around inf 77.0%
associate-*r/77.5%
Simplified77.5%
if 9.99999999999999967e78 < t Initial program 97.0%
clear-num97.0%
associate-/r/97.0%
Applied egg-rr97.0%
Taylor expanded in z around inf 44.0%
associate-/l*59.4%
sub-neg59.4%
mul-1-neg59.4%
remove-double-neg59.4%
Simplified59.4%
Taylor expanded in y around 0 31.2%
*-commutative31.2%
associate-*r/44.0%
Simplified44.0%
Final simplification70.2%
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 (- 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) {
return x_s * (x_m * -t);
}
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 * -t)
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 * -t);
}
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 * -t)
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(-t))) 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 * -t); end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m * (-t)), $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 \left(-t\right)\right)
\end{array}
Initial program 95.8%
Taylor expanded in z around 0 66.2%
+-commutative66.2%
associate-*r/65.6%
*-commutative65.6%
associate-*r*65.6%
neg-mul-165.6%
distribute-rgt-out67.9%
unsub-neg67.9%
Simplified67.9%
Taylor expanded in y around 0 22.3%
associate-*r*22.3%
mul-1-neg22.3%
Simplified22.3%
Final simplification22.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))))
(t_2 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (< t_2 -7.623226303312042e-196)
t_1
(if (< t_2 1.4133944927702302e-211)
(+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z))))
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} 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 / z) - (t * (1.0d0 / (1.0d0 - z))))
t_2 = x * ((y / z) - (t / (1.0d0 - z)))
if (t_2 < (-7.623226303312042d-196)) then
tmp = t_1
else if (t_2 < 1.4133944927702302d-211) then
tmp = ((y * x) / z) + -((t * x) / (1.0d0 - z))
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 / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))) t_2 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_2 < -7.623226303312042e-196: tmp = t_1 elif t_2 < 1.4133944927702302e-211: tmp = ((y * x) / z) + -((t * x) / (1.0 - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - Float64(t * Float64(1.0 / Float64(1.0 - z))))) t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) tmp = 0.0 if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = Float64(Float64(Float64(y * x) / z) + Float64(-Float64(Float64(t * x) / Float64(1.0 - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))); t_2 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = ((y * x) / z) + -((t * x) / (1.0 - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * N[(1.0 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -7.623226303312042e-196], t$95$1, If[Less[t$95$2, 1.4133944927702302e-211], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] + (-N[(N[(t * x), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t\_2 < -7.623226303312042 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4133944927702302 \cdot 10^{-211}:\\
\;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024031
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))