
(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 13 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
(*
x_s
(if (<= x_m 2000000000000.0)
(- (/ (* x_m y) z) (/ (* x_m t) (- 1.0 z)))
(* x_m (+ (/ y z) (/ t (+ -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 tmp;
if (x_m <= 2000000000000.0) {
tmp = ((x_m * y) / z) - ((x_m * t) / (1.0 - z));
} else {
tmp = x_m * ((y / z) + (t / (-1.0 + z)));
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x_m <= 2000000000000.0d0) then
tmp = ((x_m * y) / z) - ((x_m * t) / (1.0d0 - z))
else
tmp = x_m * ((y / z) + (t / ((-1.0d0) + z)))
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (x_m <= 2000000000000.0) {
tmp = ((x_m * y) / z) - ((x_m * t) / (1.0 - z));
} else {
tmp = x_m * ((y / z) + (t / (-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): tmp = 0 if x_m <= 2000000000000.0: tmp = ((x_m * y) / z) - ((x_m * t) / (1.0 - z)) else: tmp = x_m * ((y / z) + (t / (-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) tmp = 0.0 if (x_m <= 2000000000000.0) tmp = Float64(Float64(Float64(x_m * y) / z) - Float64(Float64(x_m * t) / Float64(1.0 - z))); else tmp = Float64(x_m * Float64(Float64(y / z) + Float64(t / 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) tmp = 0.0; if (x_m <= 2000000000000.0) tmp = ((x_m * y) / z) - ((x_m * t) / (1.0 - z)); else tmp = x_m * ((y / z) + (t / (-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_] := N[(x$95$s * If[LessEqual[x$95$m, 2000000000000.0], N[(N[(N[(x$95$m * y), $MachinePrecision] / z), $MachinePrecision] - N[(N[(x$95$m * t), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(y / z), $MachinePrecision] + N[(t / 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)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2000000000000:\\
\;\;\;\;\frac{x\_m \cdot y}{z} - \frac{x\_m \cdot t}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} + \frac{t}{-1 + z}\right)\\
\end{array}
\end{array}
if x < 2e12Initial program 95.4%
Taylor expanded in y around 0 92.2%
if 2e12 < x Initial program 96.9%
Final simplification93.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 (let* ((t_1 (+ (/ y z) (/ t (+ -1.0 z))))) (* x_s (if (<= t_1 (- INFINITY)) (* y (/ x_m z)) (* x_m t_1)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (y / z) + (t / (-1.0 + z));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (x_m / z);
} else {
tmp = x_m * t_1;
}
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 / (-1.0 + z));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (x_m / z);
} else {
tmp = x_m * 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 = (y / z) + (t / (-1.0 + z)) tmp = 0 if t_1 <= -math.inf: tmp = y * (x_m / z) else: tmp = x_m * 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(y / z) + Float64(t / Float64(-1.0 + z))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(x_m / z)); else tmp = Float64(x_m * 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 = (y / z) + (t / (-1.0 + z)); tmp = 0.0; if (t_1 <= -Inf) tmp = y * (x_m / z); else tmp = x_m * 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[(y / z), $MachinePrecision] + N[(t / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * t$95$1), $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 -\infty:\\
\;\;\;\;y \cdot \frac{x\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot t\_1\\
\end{array}
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 81.5%
Taylor expanded in y around inf 95.9%
associate-*r/95.9%
associate-*r*95.9%
neg-mul-195.9%
*-commutative95.9%
times-frac99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around 0 99.9%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 97.3%
Final simplification97.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 z))))
(*
x_s
(if (<= z -1.85e+92)
t_1
(if (<= z 16500.0)
(* x_m (- (/ y z) t))
(if (<= z 1.95e+131) (* t (/ x_m (+ -1.0 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 (z <= -1.85e+92) {
tmp = t_1;
} else if (z <= 16500.0) {
tmp = x_m * ((y / z) - t);
} else if (z <= 1.95e+131) {
tmp = t * (x_m / (-1.0 + 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 (z <= (-1.85d+92)) then
tmp = t_1
else if (z <= 16500.0d0) then
tmp = x_m * ((y / z) - t)
else if (z <= 1.95d+131) then
tmp = t * (x_m / ((-1.0d0) + 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 (z <= -1.85e+92) {
tmp = t_1;
} else if (z <= 16500.0) {
tmp = x_m * ((y / z) - t);
} else if (z <= 1.95e+131) {
tmp = t * (x_m / (-1.0 + 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 z <= -1.85e+92: tmp = t_1 elif z <= 16500.0: tmp = x_m * ((y / z) - t) elif z <= 1.95e+131: tmp = t * (x_m / (-1.0 + 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(y / z)) tmp = 0.0 if (z <= -1.85e+92) tmp = t_1; elseif (z <= 16500.0) tmp = Float64(x_m * Float64(Float64(y / z) - t)); elseif (z <= 1.95e+131) tmp = Float64(t * Float64(x_m / Float64(-1.0 + 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 (z <= -1.85e+92) tmp = t_1; elseif (z <= 16500.0) tmp = x_m * ((y / z) - t); elseif (z <= 1.95e+131) tmp = t * (x_m / (-1.0 + 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[(y / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.85e+92], t$95$1, If[LessEqual[z, 16500.0], N[(x$95$m * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+131], N[(t * N[(x$95$m / N[(-1.0 + z), $MachinePrecision]), $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 \frac{y}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 16500:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+131}:\\
\;\;\;\;t \cdot \frac{x\_m}{-1 + z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if z < -1.84999999999999999e92 or 1.95e131 < z Initial program 98.3%
Taylor expanded in y around inf 64.2%
associate-*r/70.3%
Simplified70.3%
if -1.84999999999999999e92 < z < 16500Initial program 94.6%
Taylor expanded in z around 0 91.7%
if 16500 < z < 1.95e131Initial program 96.0%
Taylor expanded in y around 0 67.5%
mul-1-neg67.5%
associate-/l*74.5%
distribute-rgt-neg-in74.5%
distribute-neg-frac274.5%
neg-sub074.5%
associate--r-74.5%
metadata-eval74.5%
Simplified74.5%
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 (or (<= z -118000.0) (not (<= z 1.0)))
(* x_m (/ (+ t y) z))
(/ (* x_m (- y (* t z))) 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 <= -118000.0) || !(z <= 1.0)) {
tmp = x_m * ((t + y) / z);
} else {
tmp = (x_m * (y - (t * z))) / 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 <= (-118000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x_m * ((t + y) / z)
else
tmp = (x_m * (y - (t * z))) / 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 <= -118000.0) || !(z <= 1.0)) {
tmp = x_m * ((t + y) / z);
} else {
tmp = (x_m * (y - (t * z))) / 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 <= -118000.0) or not (z <= 1.0): tmp = x_m * ((t + y) / z) else: tmp = (x_m * (y - (t * z))) / 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 <= -118000.0) || !(z <= 1.0)) tmp = Float64(x_m * Float64(Float64(t + y) / z)); else tmp = Float64(Float64(x_m * Float64(y - Float64(t * z))) / 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 <= -118000.0) || ~((z <= 1.0))) tmp = x_m * ((t + y) / z); else tmp = (x_m * (y - (t * z))) / 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[z, -118000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x$95$m * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m * N[(y - N[(t * z), $MachinePrecision]), $MachinePrecision]), $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}\;z \leq -118000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x\_m \cdot \frac{t + y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - t \cdot z\right)}{z}\\
\end{array}
\end{array}
if z < -118000 or 1 < z Initial program 97.9%
Taylor expanded in z around inf 84.8%
associate-/l*97.2%
neg-mul-197.2%
sub-neg97.2%
remove-double-neg97.2%
neg-mul-197.2%
neg-mul-197.2%
distribute-lft-in97.2%
neg-mul-197.2%
sub-neg97.2%
*-commutative97.2%
associate-*l/97.2%
*-commutative97.2%
associate-*r/97.2%
sub-neg97.2%
neg-mul-197.2%
distribute-lft-in97.2%
neg-mul-197.2%
remove-double-neg97.2%
neg-mul-197.2%
remove-double-neg97.2%
+-commutative97.2%
Simplified97.2%
if -118000 < z < 1Initial program 94.2%
clear-num94.1%
associate-/r/94.2%
Applied egg-rr94.2%
Taylor expanded in z around 0 90.7%
+-commutative90.7%
*-commutative90.7%
mul-1-neg90.7%
associate-*r*94.2%
*-commutative94.2%
distribute-lft-neg-out94.2%
associate-*r*94.2%
distribute-rgt-out96.3%
distribute-lft-neg-in96.3%
unsub-neg96.3%
Simplified96.3%
Final simplification96.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
(*
x_s
(if (or (<= z -118000.0) (not (<= z 1.0)))
(* x_m (/ (+ t y) 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 <= -118000.0) || !(z <= 1.0)) {
tmp = x_m * ((t + y) / 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 <= (-118000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x_m * ((t + y) / 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 <= -118000.0) || !(z <= 1.0)) {
tmp = x_m * ((t + y) / 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 <= -118000.0) or not (z <= 1.0): tmp = x_m * ((t + y) / 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 <= -118000.0) || !(z <= 1.0)) tmp = Float64(x_m * Float64(Float64(t + y) / 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 <= -118000.0) || ~((z <= 1.0))) tmp = x_m * ((t + y) / 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, -118000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x$95$m * N[(N[(t + y), $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 -118000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x\_m \cdot \frac{t + y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -118000 or 1 < z Initial program 97.9%
Taylor expanded in z around inf 84.8%
associate-/l*97.2%
neg-mul-197.2%
sub-neg97.2%
remove-double-neg97.2%
neg-mul-197.2%
neg-mul-197.2%
distribute-lft-in97.2%
neg-mul-197.2%
sub-neg97.2%
*-commutative97.2%
associate-*l/97.2%
*-commutative97.2%
associate-*r/97.2%
sub-neg97.2%
neg-mul-197.2%
distribute-lft-in97.2%
neg-mul-197.2%
remove-double-neg97.2%
neg-mul-197.2%
remove-double-neg97.2%
+-commutative97.2%
Simplified97.2%
if -118000 < z < 1Initial program 94.2%
Taylor expanded in z around 0 93.7%
Final simplification95.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
(*
x_s
(if (or (<= t -2.55e+67) (not (<= t 9.5e+43)))
(* t (/ x_m (+ -1.0 z)))
(/ (* 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 tmp;
if ((t <= -2.55e+67) || !(t <= 9.5e+43)) {
tmp = t * (x_m / (-1.0 + z));
} else {
tmp = (x_m * y) / 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 <= (-2.55d+67)) .or. (.not. (t <= 9.5d+43))) then
tmp = t * (x_m / ((-1.0d0) + z))
else
tmp = (x_m * y) / 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 <= -2.55e+67) || !(t <= 9.5e+43)) {
tmp = t * (x_m / (-1.0 + z));
} 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): tmp = 0 if (t <= -2.55e+67) or not (t <= 9.5e+43): tmp = t * (x_m / (-1.0 + z)) 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) tmp = 0.0 if ((t <= -2.55e+67) || !(t <= 9.5e+43)) tmp = Float64(t * Float64(x_m / Float64(-1.0 + z))); 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) tmp = 0.0; if ((t <= -2.55e+67) || ~((t <= 9.5e+43))) tmp = t * (x_m / (-1.0 + z)); 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_] := N[(x$95$s * If[Or[LessEqual[t, -2.55e+67], N[Not[LessEqual[t, 9.5e+43]], $MachinePrecision]], N[(t * N[(x$95$m / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $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)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{+67} \lor \neg \left(t \leq 9.5 \cdot 10^{+43}\right):\\
\;\;\;\;t \cdot \frac{x\_m}{-1 + z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m \cdot y}{z}\\
\end{array}
\end{array}
if t < -2.5500000000000001e67 or 9.5000000000000004e43 < t Initial program 97.3%
Taylor expanded in y around 0 65.4%
mul-1-neg65.4%
associate-/l*72.1%
distribute-rgt-neg-in72.1%
distribute-neg-frac272.1%
neg-sub072.1%
associate--r-72.1%
metadata-eval72.1%
Simplified72.1%
if -2.5500000000000001e67 < t < 9.5000000000000004e43Initial program 94.6%
Taylor expanded in y around inf 83.4%
Final simplification78.5%
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 (or (<= y -6.2e-142) (not (<= y 1.95e-142)))
(* 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 ((y <= -6.2e-142) || !(y <= 1.95e-142)) {
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 ((y <= (-6.2d-142)) .or. (.not. (y <= 1.95d-142))) 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 ((y <= -6.2e-142) || !(y <= 1.95e-142)) {
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 (y <= -6.2e-142) or not (y <= 1.95e-142): 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 ((y <= -6.2e-142) || !(y <= 1.95e-142)) 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 ((y <= -6.2e-142) || ~((y <= 1.95e-142))) 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[Or[LessEqual[y, -6.2e-142], N[Not[LessEqual[y, 1.95e-142]], $MachinePrecision]], 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}\;y \leq -6.2 \cdot 10^{-142} \lor \neg \left(y \leq 1.95 \cdot 10^{-142}\right):\\
\;\;\;\;x\_m \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{t}{z}\\
\end{array}
\end{array}
if y < -6.2e-142 or 1.9500000000000002e-142 < y Initial program 95.1%
Taylor expanded in y around inf 72.1%
associate-*r/71.3%
Simplified71.3%
if -6.2e-142 < y < 1.9500000000000002e-142Initial program 98.2%
clear-num98.0%
associate-/r/98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 55.9%
associate-/l*60.5%
neg-mul-160.5%
sub-neg60.5%
remove-double-neg60.5%
Simplified60.5%
Taylor expanded in y around 0 58.9%
Final simplification68.5%
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 (or (<= z -3.1e-65) (not (<= z 1.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 <= -3.1e-65) || !(z <= 1.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 <= (-3.1d-65)) .or. (.not. (z <= 1.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 <= -3.1e-65) || !(z <= 1.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 <= -3.1e-65) or not (z <= 1.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 <= -3.1e-65) || !(z <= 1.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 <= -3.1e-65) || ~((z <= 1.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, -3.1e-65], N[Not[LessEqual[z, 1.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 -3.1 \cdot 10^{-65} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x\_m \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -3.10000000000000016e-65 or 1 < z Initial program 98.1%
clear-num98.0%
associate-/r/98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 85.2%
associate-/l*96.2%
neg-mul-196.2%
sub-neg96.2%
remove-double-neg96.2%
Simplified96.2%
Taylor expanded in y around 0 53.3%
if -3.10000000000000016e-65 < z < 1Initial program 93.6%
Taylor expanded in z around 0 93.1%
Taylor expanded in y around 0 39.0%
neg-mul-139.0%
*-commutative39.0%
distribute-rgt-neg-out39.0%
Simplified39.0%
Final simplification46.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 (* x_s (if (or (<= z 2.7e-306) (not (<= z 1.0))) (* t (/ x_m 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 <= 2.7e-306) || !(z <= 1.0)) {
tmp = t * (x_m / 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 <= 2.7d-306) .or. (.not. (z <= 1.0d0))) then
tmp = t * (x_m / 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 <= 2.7e-306) || !(z <= 1.0)) {
tmp = t * (x_m / 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 <= 2.7e-306) or not (z <= 1.0): tmp = t * (x_m / 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 <= 2.7e-306) || !(z <= 1.0)) tmp = Float64(t * Float64(x_m / 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 <= 2.7e-306) || ~((z <= 1.0))) tmp = t * (x_m / 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, 2.7e-306], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(t * N[(x$95$m / 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 2.7 \cdot 10^{-306} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;t \cdot \frac{x\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < 2.70000000000000009e-306 or 1 < z Initial program 97.6%
clear-num97.5%
associate-/r/97.5%
Applied egg-rr97.5%
Taylor expanded in z around inf 80.2%
associate-/l*87.0%
neg-mul-187.0%
sub-neg87.0%
remove-double-neg87.0%
Simplified87.0%
Taylor expanded in y around 0 40.8%
associate-/l*47.2%
Simplified47.2%
if 2.70000000000000009e-306 < z < 1Initial program 91.9%
Taylor expanded in z around 0 91.0%
Taylor expanded in y around 0 41.2%
neg-mul-141.2%
*-commutative41.2%
distribute-rgt-neg-out41.2%
Simplified41.2%
Final simplification45.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 (<= t -5.9e+186)
(* x_m (- t))
(if (<= t 2.15e+71) (/ (* 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 <= -5.9e+186) {
tmp = x_m * -t;
} else if (t <= 2.15e+71) {
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 <= (-5.9d+186)) then
tmp = x_m * -t
else if (t <= 2.15d+71) 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 <= -5.9e+186) {
tmp = x_m * -t;
} else if (t <= 2.15e+71) {
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 <= -5.9e+186: tmp = x_m * -t elif t <= 2.15e+71: 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 <= -5.9e+186) tmp = Float64(x_m * Float64(-t)); elseif (t <= 2.15e+71) tmp = Float64(Float64(x_m * 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 <= -5.9e+186) tmp = x_m * -t; elseif (t <= 2.15e+71) 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, -5.9e+186], N[(x$95$m * (-t)), $MachinePrecision], If[LessEqual[t, 2.15e+71], N[(N[(x$95$m * y), $MachinePrecision] / z), $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 -5.9 \cdot 10^{+186}:\\
\;\;\;\;x\_m \cdot \left(-t\right)\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{+71}:\\
\;\;\;\;\frac{x\_m \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -5.89999999999999982e186Initial program 99.9%
Taylor expanded in z around 0 71.6%
Taylor expanded in y around 0 55.6%
neg-mul-155.6%
*-commutative55.6%
distribute-rgt-neg-out55.6%
Simplified55.6%
if -5.89999999999999982e186 < t < 2.14999999999999992e71Initial program 94.2%
Taylor expanded in y around inf 79.9%
if 2.14999999999999992e71 < t Initial program 98.4%
clear-num98.2%
associate-/r/98.4%
Applied egg-rr98.4%
Taylor expanded in z around inf 51.4%
associate-/l*58.4%
neg-mul-158.4%
sub-neg58.4%
remove-double-neg58.4%
Simplified58.4%
Taylor expanded in y around 0 48.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
(*
x_s
(if (<= y -4.5e-141)
(* y (/ x_m z))
(if (<= y 6e-142) (* x_m (/ t z)) (* 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 tmp;
if (y <= -4.5e-141) {
tmp = y * (x_m / z);
} else if (y <= 6e-142) {
tmp = x_m * (t / z);
} else {
tmp = x_m * (y / 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 <= (-4.5d-141)) then
tmp = y * (x_m / z)
else if (y <= 6d-142) then
tmp = x_m * (t / z)
else
tmp = x_m * (y / 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 <= -4.5e-141) {
tmp = y * (x_m / z);
} else if (y <= 6e-142) {
tmp = x_m * (t / z);
} 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): tmp = 0 if y <= -4.5e-141: tmp = y * (x_m / z) elif y <= 6e-142: tmp = x_m * (t / z) 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) tmp = 0.0 if (y <= -4.5e-141) tmp = Float64(y * Float64(x_m / z)); elseif (y <= 6e-142) tmp = Float64(x_m * Float64(t / z)); else tmp = Float64(x_m * Float64(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) tmp = 0.0; if (y <= -4.5e-141) tmp = y * (x_m / z); elseif (y <= 6e-142) tmp = x_m * (t / z); 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_] := N[(x$95$s * If[LessEqual[y, -4.5e-141], N[(y * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-142], N[(x$95$m * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(y / 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 -4.5 \cdot 10^{-141}:\\
\;\;\;\;y \cdot \frac{x\_m}{z}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-142}:\\
\;\;\;\;x\_m \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -4.5e-141Initial program 94.5%
Taylor expanded in y around inf 87.2%
associate-*r/87.2%
associate-*r*87.2%
neg-mul-187.2%
*-commutative87.2%
times-frac87.1%
distribute-frac-neg87.1%
distribute-neg-frac287.1%
neg-sub087.1%
associate--r-87.1%
metadata-eval87.1%
Simplified87.1%
Taylor expanded in t around 0 69.8%
if -4.5e-141 < y < 6.0000000000000002e-142Initial program 98.2%
clear-num98.0%
associate-/r/98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 55.9%
associate-/l*60.5%
neg-mul-160.5%
sub-neg60.5%
remove-double-neg60.5%
Simplified60.5%
Taylor expanded in y around 0 58.9%
if 6.0000000000000002e-142 < y Initial program 95.8%
Taylor expanded in y around inf 75.8%
associate-*r/74.0%
Simplified74.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 (* x_s (if (<= z 1.0) (* x_m (- t)) (* 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 <= 1.0) {
tmp = x_m * -t;
} 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 <= 1.0d0) then
tmp = x_m * -t
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 <= 1.0) {
tmp = x_m * -t;
} 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 <= 1.0: tmp = x_m * -t 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 <= 1.0) tmp = Float64(x_m * Float64(-t)); else tmp = Float64(x_m * 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 <= 1.0) tmp = x_m * -t; 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[LessEqual[z, 1.0], N[(x$95$m * (-t)), $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 1:\\
\;\;\;\;x\_m \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot t\\
\end{array}
\end{array}
if z < 1Initial program 95.6%
Taylor expanded in z around 0 81.6%
Taylor expanded in y around 0 31.5%
neg-mul-131.5%
*-commutative31.5%
distribute-rgt-neg-out31.5%
Simplified31.5%
if 1 < z Initial program 96.4%
Taylor expanded in z around 0 28.4%
Taylor expanded in y around 0 6.6%
neg-mul-16.6%
*-commutative6.6%
distribute-rgt-neg-out6.6%
Simplified6.6%
add-sqr-sqrt3.6%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod7.8%
add-sqr-sqrt13.8%
pow113.8%
Applied egg-rr13.8%
unpow113.8%
Simplified13.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 (* 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 * 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 t\right)
\end{array}
Initial program 95.8%
Taylor expanded in z around 0 68.9%
Taylor expanded in y around 0 25.6%
neg-mul-125.6%
*-commutative25.6%
distribute-rgt-neg-out25.6%
Simplified25.6%
add-sqr-sqrt10.7%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod3.4%
add-sqr-sqrt7.5%
pow17.5%
Applied egg-rr7.5%
unpow17.5%
Simplified7.5%
(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 2024137
(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)))))