
(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 12 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 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (- (* y (- 1.0 z)) (* z t)))
(t_2 (* x_m (+ (/ y z) (/ t (+ z -1.0))))))
(*
x_s
(if (<= t_2 (- INFINITY))
(* (/ t_1 (- 1.0 z)) (/ x_m z))
(if (<= t_2 1e+274) t_2 (* (* x_m t_1) (/ 1.0 (* z (- 1.0 z)))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (y * (1.0 - z)) - (z * t);
double t_2 = x_m * ((y / z) + (t / (z + -1.0)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (t_1 / (1.0 - z)) * (x_m / z);
} else if (t_2 <= 1e+274) {
tmp = t_2;
} else {
tmp = (x_m * t_1) * (1.0 / (z * (1.0 - z)));
}
return x_s * tmp;
}
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 * (1.0 - z)) - (z * t);
double t_2 = x_m * ((y / z) + (t / (z + -1.0)));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (t_1 / (1.0 - z)) * (x_m / z);
} else if (t_2 <= 1e+274) {
tmp = t_2;
} else {
tmp = (x_m * t_1) * (1.0 / (z * (1.0 - z)));
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = (y * (1.0 - z)) - (z * t) t_2 = x_m * ((y / z) + (t / (z + -1.0))) tmp = 0 if t_2 <= -math.inf: tmp = (t_1 / (1.0 - z)) * (x_m / z) elif t_2 <= 1e+274: tmp = t_2 else: tmp = (x_m * t_1) * (1.0 / (z * (1.0 - z))) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(y * Float64(1.0 - z)) - Float64(z * t)) t_2 = Float64(x_m * Float64(Float64(y / z) + Float64(t / Float64(z + -1.0)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(t_1 / Float64(1.0 - z)) * Float64(x_m / z)); elseif (t_2 <= 1e+274) tmp = t_2; else tmp = Float64(Float64(x_m * t_1) * Float64(1.0 / Float64(z * Float64(1.0 - z)))); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = (y * (1.0 - z)) - (z * t); t_2 = x_m * ((y / z) + (t / (z + -1.0))); tmp = 0.0; if (t_2 <= -Inf) tmp = (t_1 / (1.0 - z)) * (x_m / z); elseif (t_2 <= 1e+274) tmp = t_2; else tmp = (x_m * t_1) * (1.0 / (z * (1.0 - z))); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x$95$m * N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(N[(t$95$1 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+274], t$95$2, N[(N[(x$95$m * t$95$1), $MachinePrecision] * N[(1.0 / N[(z * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - z\right) - z \cdot t\\
t_2 := x\_m \cdot \left(\frac{y}{z} + \frac{t}{z + -1}\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{t\_1}{1 - z} \cdot \frac{x\_m}{z}\\
\mathbf{elif}\;t\_2 \leq 10^{+274}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(x\_m \cdot t\_1\right) \cdot \frac{1}{z \cdot \left(1 - z\right)}\\
\end{array}
\end{array}
\end{array}
if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < -inf.0Initial program 74.8%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < 9.99999999999999921e273Initial program 97.4%
if 9.99999999999999921e273 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) Initial program 87.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6497.5
Applied rewrites97.5%
Final simplification97.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (+ (/ y z) (/ t (+ z -1.0)))))
(*
x_s
(if (<= t_1 (- INFINITY))
(* y (/ x_m z))
(if (<= t_1 2e+291) (* x_m t_1) (/ (* x_m y) 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 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (x_m / z);
} else if (t_1 <= 2e+291) {
tmp = x_m * t_1;
} else {
tmp = (x_m * y) / z;
}
return x_s * tmp;
}
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 / (z + -1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (x_m / z);
} else if (t_1 <= 2e+291) {
tmp = x_m * t_1;
} else {
tmp = (x_m * y) / 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 = (y / z) + (t / (z + -1.0)) tmp = 0 if t_1 <= -math.inf: tmp = y * (x_m / z) elif t_1 <= 2e+291: tmp = x_m * t_1 else: tmp = (x_m * y) / 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(Float64(y / z) + Float64(t / Float64(z + -1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(x_m / z)); elseif (t_1 <= 2e+291) tmp = Float64(x_m * t_1); else tmp = Float64(Float64(x_m * y) / 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 = (y / z) + (t / (z + -1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = y * (x_m / z); elseif (t_1 <= 2e+291) tmp = x_m * t_1; else tmp = (x_m * y) / 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[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+291], N[(x$95$m * t$95$1), $MachinePrecision], N[(N[(x$95$m * y), $MachinePrecision] / z), $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}{z + -1}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{x\_m}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+291}:\\
\;\;\;\;x\_m \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m \cdot y}{z}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 70.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6499.9
Applied rewrites99.9%
Applied rewrites99.9%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 1.9999999999999999e291Initial program 97.8%
if 1.9999999999999999e291 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 56.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6499.8
Applied rewrites99.8%
Final simplification98.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -6.5e-106)
(/ (* x_m (+ y t)) z)
(if (<= z -7.6e-127)
(* x_m (- (fma t z t)))
(if (<= z 1.0) (* y (/ x_m z)) (* (/ x_m z) (+ 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 (z <= -6.5e-106) {
tmp = (x_m * (y + t)) / z;
} else if (z <= -7.6e-127) {
tmp = x_m * -fma(t, z, t);
} else if (z <= 1.0) {
tmp = y * (x_m / z);
} else {
tmp = (x_m / z) * (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 (z <= -6.5e-106) tmp = Float64(Float64(x_m * Float64(y + t)) / z); elseif (z <= -7.6e-127) tmp = Float64(x_m * Float64(-fma(t, z, t))); elseif (z <= 1.0) tmp = Float64(y * Float64(x_m / z)); else tmp = Float64(Float64(x_m / z) * Float64(y + t)); end return Float64(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, -6.5e-106], N[(N[(x$95$m * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -7.6e-127], N[(x$95$m * (-N[(t * z + t), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 1.0], N[(y * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * N[(y + 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 -6.5 \cdot 10^{-106}:\\
\;\;\;\;\frac{x\_m \cdot \left(y + t\right)}{z}\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-127}:\\
\;\;\;\;x\_m \cdot \left(-\mathsf{fma}\left(t, z, t\right)\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;y \cdot \frac{x\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \left(y + t\right)\\
\end{array}
\end{array}
if z < -6.4999999999999997e-106Initial program 95.9%
Taylor expanded in z around inf
*-commutativeN/A
remove-double-negN/A
neg-mul-1N/A
distribute-lft-out--N/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites85.6%
if -6.4999999999999997e-106 < z < -7.60000000000000005e-127Initial program 100.0%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
metadata-evalN/A
lower-+.f6485.7
Applied rewrites85.7%
Taylor expanded in z around 0
Applied rewrites85.7%
if -7.60000000000000005e-127 < z < 1Initial program 87.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6473.4
Applied rewrites73.4%
Applied rewrites77.5%
if 1 < z Initial program 98.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6445.5
Applied rewrites45.5%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6490.4
Applied rewrites90.4%
Applied rewrites90.7%
Final simplification83.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (* x_m (+ y t)) z)))
(*
x_s
(if (<= z -6.5e-106)
t_1
(if (<= z -7.6e-127)
(* x_m (- (fma t z t)))
(if (<= z 5.2e+16) (* y (/ x_m 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 * (y + t)) / z;
double tmp;
if (z <= -6.5e-106) {
tmp = t_1;
} else if (z <= -7.6e-127) {
tmp = x_m * -fma(t, z, t);
} else if (z <= 5.2e+16) {
tmp = y * (x_m / 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 * Float64(y + t)) / z) tmp = 0.0 if (z <= -6.5e-106) tmp = t_1; elseif (z <= -7.6e-127) tmp = Float64(x_m * Float64(-fma(t, z, t))); elseif (z <= 5.2e+16) tmp = Float64(y * Float64(x_m / z)); else tmp = t_1; end return Float64(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 * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -6.5e-106], t$95$1, If[LessEqual[z, -7.6e-127], N[(x$95$m * (-N[(t * z + t), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 5.2e+16], N[(y * N[(x$95$m / 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 \cdot \left(y + t\right)}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-106}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-127}:\\
\;\;\;\;x\_m \cdot \left(-\mathsf{fma}\left(t, z, t\right)\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+16}:\\
\;\;\;\;y \cdot \frac{x\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -6.4999999999999997e-106 or 5.2e16 < z Initial program 96.7%
Taylor expanded in z around inf
*-commutativeN/A
remove-double-negN/A
neg-mul-1N/A
distribute-lft-out--N/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites87.2%
if -6.4999999999999997e-106 < z < -7.60000000000000005e-127Initial program 100.0%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
metadata-evalN/A
lower-+.f6485.7
Applied rewrites85.7%
Taylor expanded in z around 0
Applied rewrites85.7%
if -7.60000000000000005e-127 < z < 5.2e16Initial program 88.3%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6474.4
Applied rewrites74.4%
Applied rewrites78.3%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (- t))))
(*
x_s
(if (<= t -9e+175)
t_1
(if (<= t 3.1e-212)
(/ (* x_m y) z)
(if (<= t 7.5e+176) (* y (/ x_m 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 * -t;
double tmp;
if (t <= -9e+175) {
tmp = t_1;
} else if (t <= 3.1e-212) {
tmp = (x_m * y) / z;
} else if (t <= 7.5e+176) {
tmp = y * (x_m / 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 * -t
if (t <= (-9d+175)) then
tmp = t_1
else if (t <= 3.1d-212) then
tmp = (x_m * y) / z
else if (t <= 7.5d+176) then
tmp = y * (x_m / 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 * -t;
double tmp;
if (t <= -9e+175) {
tmp = t_1;
} else if (t <= 3.1e-212) {
tmp = (x_m * y) / z;
} else if (t <= 7.5e+176) {
tmp = y * (x_m / 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 * -t tmp = 0 if t <= -9e+175: tmp = t_1 elif t <= 3.1e-212: tmp = (x_m * y) / z elif t <= 7.5e+176: tmp = y * (x_m / 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(x_m * Float64(-t)) tmp = 0.0 if (t <= -9e+175) tmp = t_1; elseif (t <= 3.1e-212) tmp = Float64(Float64(x_m * y) / z); elseif (t <= 7.5e+176) tmp = Float64(y * Float64(x_m / 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 * -t; tmp = 0.0; if (t <= -9e+175) tmp = t_1; elseif (t <= 3.1e-212) tmp = (x_m * y) / z; elseif (t <= 7.5e+176) tmp = y * (x_m / 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[(x$95$m * (-t)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -9e+175], t$95$1, If[LessEqual[t, 3.1e-212], N[(N[(x$95$m * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 7.5e+176], N[(y * N[(x$95$m / 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 := x\_m \cdot \left(-t\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+175}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-212}:\\
\;\;\;\;\frac{x\_m \cdot y}{z}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+176}:\\
\;\;\;\;y \cdot \frac{x\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -8.99999999999999979e175 or 7.499999999999999e176 < t Initial program 96.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
metadata-evalN/A
lower-+.f6480.8
Applied rewrites80.8%
Taylor expanded in z around 0
Applied rewrites43.8%
if -8.99999999999999979e175 < t < 3.10000000000000006e-212Initial program 91.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6476.4
Applied rewrites76.4%
if 3.10000000000000006e-212 < t < 7.499999999999999e176Initial program 93.5%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6468.4
Applied rewrites68.4%
Applied rewrites74.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -3.8e-15)
(/ (* x_m (+ y t)) z)
(if (<= z 1.0) (* 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 <= -3.8e-15) {
tmp = (x_m * (y + t)) / z;
} else if (z <= 1.0) {
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 <= (-3.8d-15)) then
tmp = (x_m * (y + t)) / z
else if (z <= 1.0d0) 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 <= -3.8e-15) {
tmp = (x_m * (y + t)) / z;
} else if (z <= 1.0) {
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 <= -3.8e-15: tmp = (x_m * (y + t)) / z elif z <= 1.0: 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 <= -3.8e-15) tmp = Float64(Float64(x_m * Float64(y + t)) / z); elseif (z <= 1.0) 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 <= -3.8e-15) tmp = (x_m * (y + t)) / z; elseif (z <= 1.0) 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, -3.8e-15], N[(N[(x$95$m * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.0], 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 -3.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{x\_m \cdot \left(y + t\right)}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{y + t}{z}\\
\end{array}
\end{array}
if z < -3.8000000000000002e-15Initial program 94.4%
Taylor expanded in z around inf
*-commutativeN/A
remove-double-negN/A
neg-mul-1N/A
distribute-lft-out--N/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites94.8%
if -3.8000000000000002e-15 < z < 1Initial program 90.6%
Taylor expanded in z around 0
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6489.3
Applied rewrites89.3%
Taylor expanded in y around 0
Applied rewrites89.3%
if 1 < z Initial program 98.2%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6498.2
Applied rewrites98.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= z -3.8e-15)
(/ (* x_m (+ y t)) z)
(if (<= z 1.0) (* x_m (- (/ y z) t)) (* (/ x_m z) (+ 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 (z <= -3.8e-15) {
tmp = (x_m * (y + t)) / z;
} else if (z <= 1.0) {
tmp = x_m * ((y / z) - t);
} else {
tmp = (x_m / z) * (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 (z <= (-3.8d-15)) then
tmp = (x_m * (y + t)) / z
else if (z <= 1.0d0) then
tmp = x_m * ((y / z) - t)
else
tmp = (x_m / z) * (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 (z <= -3.8e-15) {
tmp = (x_m * (y + t)) / z;
} else if (z <= 1.0) {
tmp = x_m * ((y / z) - t);
} else {
tmp = (x_m / z) * (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 z <= -3.8e-15: tmp = (x_m * (y + t)) / z elif z <= 1.0: tmp = x_m * ((y / z) - t) else: tmp = (x_m / z) * (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 (z <= -3.8e-15) tmp = Float64(Float64(x_m * Float64(y + t)) / z); elseif (z <= 1.0) tmp = Float64(x_m * Float64(Float64(y / z) - t)); else tmp = Float64(Float64(x_m / z) * 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 (z <= -3.8e-15) tmp = (x_m * (y + t)) / z; elseif (z <= 1.0) tmp = x_m * ((y / z) - t); else tmp = (x_m / z) * (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[z, -3.8e-15], N[(N[(x$95$m * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.0], N[(x$95$m * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * N[(y + 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 -3.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{x\_m \cdot \left(y + t\right)}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \left(y + t\right)\\
\end{array}
\end{array}
if z < -3.8000000000000002e-15Initial program 94.4%
Taylor expanded in z around inf
*-commutativeN/A
remove-double-negN/A
neg-mul-1N/A
distribute-lft-out--N/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites94.8%
if -3.8000000000000002e-15 < z < 1Initial program 90.6%
Taylor expanded in z around 0
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6489.3
Applied rewrites89.3%
Taylor expanded in y around 0
Applied rewrites89.3%
if 1 < z Initial program 98.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6445.5
Applied rewrites45.5%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6490.4
Applied rewrites90.4%
Applied rewrites90.7%
Final simplification91.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (* x_m (+ y t)) z)))
(*
x_s
(if (<= y -2.3e-160)
t_1
(if (<= y 2.5e-31) (/ (* x_m t) (+ z -1.0)) 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 * (y + t)) / z;
double tmp;
if (y <= -2.3e-160) {
tmp = t_1;
} else if (y <= 2.5e-31) {
tmp = (x_m * t) / (z + -1.0);
} 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 * (y + t)) / z
if (y <= (-2.3d-160)) then
tmp = t_1
else if (y <= 2.5d-31) then
tmp = (x_m * t) / (z + (-1.0d0))
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 * (y + t)) / z;
double tmp;
if (y <= -2.3e-160) {
tmp = t_1;
} else if (y <= 2.5e-31) {
tmp = (x_m * t) / (z + -1.0);
} 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 * (y + t)) / z tmp = 0 if y <= -2.3e-160: tmp = t_1 elif y <= 2.5e-31: tmp = (x_m * t) / (z + -1.0) 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 * Float64(y + t)) / z) tmp = 0.0 if (y <= -2.3e-160) tmp = t_1; elseif (y <= 2.5e-31) tmp = Float64(Float64(x_m * t) / Float64(z + -1.0)); 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 * (y + t)) / z; tmp = 0.0; if (y <= -2.3e-160) tmp = t_1; elseif (y <= 2.5e-31) tmp = (x_m * t) / (z + -1.0); 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 * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -2.3e-160], t$95$1, If[LessEqual[y, 2.5e-31], N[(N[(x$95$m * t), $MachinePrecision] / N[(z + -1.0), $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 \cdot \left(y + t\right)}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-160}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-31}:\\
\;\;\;\;\frac{x\_m \cdot t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -2.29999999999999985e-160 or 2.5e-31 < y Initial program 91.8%
Taylor expanded in z around inf
*-commutativeN/A
remove-double-negN/A
neg-mul-1N/A
distribute-lft-out--N/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites84.6%
if -2.29999999999999985e-160 < y < 2.5e-31Initial program 96.1%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6473.2
Applied rewrites73.2%
Taylor expanded in y around inf
Applied rewrites73.3%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lft-mult-inverseN/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
distribute-rgt-inN/A
*-lft-identityN/A
metadata-evalN/A
distribute-neg-fracN/A
distribute-lft-neg-outN/A
lft-mult-inverseN/A
Applied rewrites77.9%
Final simplification82.1%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (* x_m (/ t z)))) (* x_s (if (<= t -2.1e+94) t_1 (if (<= t 4.4e+75) (/ (* 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 = x_m * (t / z);
double tmp;
if (t <= -2.1e+94) {
tmp = t_1;
} else if (t <= 4.4e+75) {
tmp = (x_m * 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 * (t / z)
if (t <= (-2.1d+94)) then
tmp = t_1
else if (t <= 4.4d+75) then
tmp = (x_m * 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 * (t / z);
double tmp;
if (t <= -2.1e+94) {
tmp = t_1;
} else if (t <= 4.4e+75) {
tmp = (x_m * 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 * (t / z) tmp = 0 if t <= -2.1e+94: tmp = t_1 elif t <= 4.4e+75: tmp = (x_m * 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(x_m * Float64(t / z)) tmp = 0.0 if (t <= -2.1e+94) tmp = t_1; elseif (t <= 4.4e+75) tmp = Float64(Float64(x_m * 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 * (t / z); tmp = 0.0; if (t <= -2.1e+94) tmp = t_1; elseif (t <= 4.4e+75) tmp = (x_m * 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[(x$95$m * N[(t / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -2.1e+94], t$95$1, If[LessEqual[t, 4.4e+75], N[(N[(x$95$m * y), $MachinePrecision] / z), $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 := x\_m \cdot \frac{t}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+75}:\\
\;\;\;\;\frac{x\_m \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -2.09999999999999989e94 or 4.40000000000000024e75 < t Initial program 94.1%
Taylor expanded in z around inf
lower-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6464.2
Applied rewrites64.2%
Taylor expanded in y around 0
Applied rewrites54.3%
if -2.09999999999999989e94 < t < 4.40000000000000024e75Initial program 92.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6479.8
Applied rewrites79.8%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (/ (* x_m y) z))) (* x_s (if (<= y -5.4e-148) t_1 (if (<= y 1.8e+52) (/ (* x_m t) 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 * y) / z;
double tmp;
if (y <= -5.4e-148) {
tmp = t_1;
} else if (y <= 1.8e+52) {
tmp = (x_m * t) / 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 * y) / z
if (y <= (-5.4d-148)) then
tmp = t_1
else if (y <= 1.8d+52) then
tmp = (x_m * t) / 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 * y) / z;
double tmp;
if (y <= -5.4e-148) {
tmp = t_1;
} else if (y <= 1.8e+52) {
tmp = (x_m * t) / 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 * y) / z tmp = 0 if y <= -5.4e-148: tmp = t_1 elif y <= 1.8e+52: tmp = (x_m * t) / 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 * y) / z) tmp = 0.0 if (y <= -5.4e-148) tmp = t_1; elseif (y <= 1.8e+52) tmp = Float64(Float64(x_m * t) / 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 * y) / z; tmp = 0.0; if (y <= -5.4e-148) tmp = t_1; elseif (y <= 1.8e+52) tmp = (x_m * t) / 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 * y), $MachinePrecision] / z), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -5.4e-148], t$95$1, If[LessEqual[y, 1.8e+52], N[(N[(x$95$m * t), $MachinePrecision] / z), $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 \cdot y}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-148}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+52}:\\
\;\;\;\;\frac{x\_m \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -5.39999999999999976e-148 or 1.8e52 < y Initial program 90.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6482.8
Applied rewrites82.8%
if -5.39999999999999976e-148 < y < 1.8e52Initial program 96.8%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6469.9
Applied rewrites69.9%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6464.5
Applied rewrites64.5%
Taylor expanded in y around 0
Applied rewrites50.8%
Final simplification68.7%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (let* ((t_1 (* x_m (- t)))) (* x_s (if (<= t -2.6e+84) t_1 (if (<= t 7.5e+176) (* y (/ x_m 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 * -t;
double tmp;
if (t <= -2.6e+84) {
tmp = t_1;
} else if (t <= 7.5e+176) {
tmp = y * (x_m / 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 * -t
if (t <= (-2.6d+84)) then
tmp = t_1
else if (t <= 7.5d+176) then
tmp = y * (x_m / 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 * -t;
double tmp;
if (t <= -2.6e+84) {
tmp = t_1;
} else if (t <= 7.5e+176) {
tmp = y * (x_m / 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 * -t tmp = 0 if t <= -2.6e+84: tmp = t_1 elif t <= 7.5e+176: tmp = y * (x_m / 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(x_m * Float64(-t)) tmp = 0.0 if (t <= -2.6e+84) tmp = t_1; elseif (t <= 7.5e+176) tmp = Float64(y * Float64(x_m / 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 * -t; tmp = 0.0; if (t <= -2.6e+84) tmp = t_1; elseif (t <= 7.5e+176) tmp = y * (x_m / 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[(x$95$m * (-t)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -2.6e+84], t$95$1, If[LessEqual[t, 7.5e+176], N[(y * N[(x$95$m / 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 := x\_m \cdot \left(-t\right)\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+176}:\\
\;\;\;\;y \cdot \frac{x\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -2.6000000000000001e84 or 7.499999999999999e176 < t Initial program 96.4%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
metadata-evalN/A
lower-+.f6479.3
Applied rewrites79.3%
Taylor expanded in z around 0
Applied rewrites45.3%
if -2.6000000000000001e84 < t < 7.499999999999999e176Initial program 91.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6476.6
Applied rewrites76.6%
Applied rewrites76.2%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* 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 93.4%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
metadata-evalN/A
lower-+.f6449.5
Applied rewrites49.5%
Taylor expanded in z around 0
Applied rewrites27.1%
(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 2024219
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:alt
(! :herbie-platform default (if (< (* x (- (/ y z) (/ t (- 1 z)))) -3811613151656021/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 7066972463851151/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z))))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))