
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2
(+
(/ (+ (* x (/ y (- b y))) (* y (/ (- a t) (pow (- b y) 2.0)))) z)
(/ (- t a) (- b y))))
(t_3 (* z (- t a)))
(t_4 (/ (+ t_3 (* x y)) t_1))
(t_5 (* x (+ (/ y t_1) (/ t_3 (* x t_1))))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -2e-299)
t_4
(if (<= t_4 0.0)
t_2
(if (<= t_4 2e+306) t_4 (if (<= t_4 INFINITY) t_5 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = (((x * (y / (b - y))) + (y * ((a - t) / pow((b - y), 2.0)))) / z) + ((t - a) / (b - y));
double t_3 = z * (t - a);
double t_4 = (t_3 + (x * y)) / t_1;
double t_5 = x * ((y / t_1) + (t_3 / (x * t_1)));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -2e-299) {
tmp = t_4;
} else if (t_4 <= 0.0) {
tmp = t_2;
} else if (t_4 <= 2e+306) {
tmp = t_4;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = (((x * (y / (b - y))) + (y * ((a - t) / Math.pow((b - y), 2.0)))) / z) + ((t - a) / (b - y));
double t_3 = z * (t - a);
double t_4 = (t_3 + (x * y)) / t_1;
double t_5 = x * ((y / t_1) + (t_3 / (x * t_1)));
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = t_5;
} else if (t_4 <= -2e-299) {
tmp = t_4;
} else if (t_4 <= 0.0) {
tmp = t_2;
} else if (t_4 <= 2e+306) {
tmp = t_4;
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_5;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = (((x * (y / (b - y))) + (y * ((a - t) / math.pow((b - y), 2.0)))) / z) + ((t - a) / (b - y)) t_3 = z * (t - a) t_4 = (t_3 + (x * y)) / t_1 t_5 = x * ((y / t_1) + (t_3 / (x * t_1))) tmp = 0 if t_4 <= -math.inf: tmp = t_5 elif t_4 <= -2e-299: tmp = t_4 elif t_4 <= 0.0: tmp = t_2 elif t_4 <= 2e+306: tmp = t_4 elif t_4 <= math.inf: tmp = t_5 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(Float64(Float64(Float64(x * Float64(y / Float64(b - y))) + Float64(y * Float64(Float64(a - t) / (Float64(b - y) ^ 2.0)))) / z) + Float64(Float64(t - a) / Float64(b - y))) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(t_3 + Float64(x * y)) / t_1) t_5 = Float64(x * Float64(Float64(y / t_1) + Float64(t_3 / Float64(x * t_1)))) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -2e-299) tmp = t_4; elseif (t_4 <= 0.0) tmp = t_2; elseif (t_4 <= 2e+306) tmp = t_4; elseif (t_4 <= Inf) tmp = t_5; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = (((x * (y / (b - y))) + (y * ((a - t) / ((b - y) ^ 2.0)))) / z) + ((t - a) / (b - y)); t_3 = z * (t - a); t_4 = (t_3 + (x * y)) / t_1; t_5 = x * ((y / t_1) + (t_3 / (x * t_1))); tmp = 0.0; if (t_4 <= -Inf) tmp = t_5; elseif (t_4 <= -2e-299) tmp = t_4; elseif (t_4 <= 0.0) tmp = t_2; elseif (t_4 <= 2e+306) tmp = t_4; elseif (t_4 <= Inf) tmp = t_5; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 + N[(x * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(x * N[(N[(y / t$95$1), $MachinePrecision] + N[(t$95$3 / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -2e-299], t$95$4, If[LessEqual[t$95$4, 0.0], t$95$2, If[LessEqual[t$95$4, 2e+306], t$95$4, If[LessEqual[t$95$4, Infinity], t$95$5, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{x \cdot \frac{y}{b - y} + y \cdot \frac{a - t}{{\left(b - y\right)}^{2}}}{z} + \frac{t - a}{b - y}\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{t\_3 + x \cdot y}{t\_1}\\
t_5 := x \cdot \left(\frac{y}{t\_1} + \frac{t\_3}{x \cdot t\_1}\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -2 \cdot 10^{-299}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 2.00000000000000003e306 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 27.9%
Taylor expanded in x around inf 75.6%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999998e-299 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000003e306Initial program 99.6%
if -1.99999999999999998e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 16.9%
Taylor expanded in z around -inf 60.6%
associate--l+60.6%
mul-1-neg60.6%
distribute-lft-out--60.6%
associate-/l*70.5%
associate-/l*99.8%
div-sub99.8%
Simplified99.8%
Final simplification95.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
(if (<= t_1 (- INFINITY))
(+ x (* z (- (* x (/ (- y b) y)) (/ a y))))
(if (or (<= t_1 -2e-299) (and (not (<= t_1 0.0)) (<= t_1 2e+306)))
t_1
(/ (- t a) (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + (z * ((x * ((y - b) / y)) - (a / y)));
} else if ((t_1 <= -2e-299) || (!(t_1 <= 0.0) && (t_1 <= 2e+306))) {
tmp = t_1;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + (z * ((x * ((y - b) / y)) - (a / y)));
} else if ((t_1 <= -2e-299) || (!(t_1 <= 0.0) && (t_1 <= 2e+306))) {
tmp = t_1;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) tmp = 0 if t_1 <= -math.inf: tmp = x + (z * ((x * ((y - b) / y)) - (a / y))) elif (t_1 <= -2e-299) or (not (t_1 <= 0.0) and (t_1 <= 2e+306)): tmp = t_1 else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(z * Float64(Float64(x * Float64(Float64(y - b) / y)) - Float64(a / y)))); elseif ((t_1 <= -2e-299) || (!(t_1 <= 0.0) && (t_1 <= 2e+306))) tmp = t_1; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); tmp = 0.0; if (t_1 <= -Inf) tmp = x + (z * ((x * ((y - b) / y)) - (a / y))); elseif ((t_1 <= -2e-299) || (~((t_1 <= 0.0)) && (t_1 <= 2e+306))) tmp = t_1; else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(z * N[(N[(x * N[(N[(y - b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -2e-299], And[N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision], LessEqual[t$95$1, 2e+306]]], t$95$1, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + z \cdot \left(x \cdot \frac{y - b}{y} - \frac{a}{y}\right)\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-299} \lor \neg \left(t\_1 \leq 0\right) \land t\_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 27.6%
Taylor expanded in t around 0 20.8%
+-commutative20.8%
mul-1-neg20.8%
unsub-neg20.8%
*-commutative20.8%
*-commutative20.8%
Simplified20.8%
Taylor expanded in z around 0 12.1%
associate-*r/12.1%
neg-mul-112.1%
associate-/l*60.7%
Simplified60.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999998e-299 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000003e306Initial program 99.6%
if -1.99999999999999998e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 2.00000000000000003e306 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 19.5%
Taylor expanded in z around inf 76.9%
Final simplification88.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (* z (- t a)))
(t_3 (/ (+ t_2 (* x y)) t_1)))
(if (<= t_3 (- INFINITY))
(* x (+ (/ t_2 (* x t_1)) 1.0))
(if (or (<= t_3 -2e-299) (and (not (<= t_3 0.0)) (<= t_3 2e+306)))
t_3
(/ (- t a) (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = z * (t - a);
double t_3 = (t_2 + (x * y)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = x * ((t_2 / (x * t_1)) + 1.0);
} else if ((t_3 <= -2e-299) || (!(t_3 <= 0.0) && (t_3 <= 2e+306))) {
tmp = t_3;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = z * (t - a);
double t_3 = (t_2 + (x * y)) / t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = x * ((t_2 / (x * t_1)) + 1.0);
} else if ((t_3 <= -2e-299) || (!(t_3 <= 0.0) && (t_3 <= 2e+306))) {
tmp = t_3;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = z * (t - a) t_3 = (t_2 + (x * y)) / t_1 tmp = 0 if t_3 <= -math.inf: tmp = x * ((t_2 / (x * t_1)) + 1.0) elif (t_3 <= -2e-299) or (not (t_3 <= 0.0) and (t_3 <= 2e+306)): tmp = t_3 else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(z * Float64(t - a)) t_3 = Float64(Float64(t_2 + Float64(x * y)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(t_2 / Float64(x * t_1)) + 1.0)); elseif ((t_3 <= -2e-299) || (!(t_3 <= 0.0) && (t_3 <= 2e+306))) tmp = t_3; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = z * (t - a); t_3 = (t_2 + (x * y)) / t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = x * ((t_2 / (x * t_1)) + 1.0); elseif ((t_3 <= -2e-299) || (~((t_3 <= 0.0)) && (t_3 <= 2e+306))) tmp = t_3; else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 + N[(x * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(x * N[(N[(t$95$2 / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$3, -2e-299], And[N[Not[LessEqual[t$95$3, 0.0]], $MachinePrecision], LessEqual[t$95$3, 2e+306]]], t$95$3, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := z \cdot \left(t - a\right)\\
t_3 := \frac{t\_2 + x \cdot y}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;x \cdot \left(\frac{t\_2}{x \cdot t\_1} + 1\right)\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-299} \lor \neg \left(t\_3 \leq 0\right) \land t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 27.6%
Taylor expanded in x around inf 77.5%
Taylor expanded in z around 0 74.2%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999998e-299 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000003e306Initial program 99.6%
if -1.99999999999999998e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 2.00000000000000003e306 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 19.5%
Taylor expanded in z around inf 76.9%
Final simplification90.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (* z (- t a)))
(t_3 (/ (+ t_2 (* x y)) t_1)))
(if (<= t_3 (- INFINITY))
(* x (+ (/ y t_1) (/ t_2 (* x t_1))))
(if (or (<= t_3 -2e-299) (and (not (<= t_3 0.0)) (<= t_3 2e+306)))
t_3
(/ (- t a) (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = z * (t - a);
double t_3 = (t_2 + (x * y)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = x * ((y / t_1) + (t_2 / (x * t_1)));
} else if ((t_3 <= -2e-299) || (!(t_3 <= 0.0) && (t_3 <= 2e+306))) {
tmp = t_3;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = z * (t - a);
double t_3 = (t_2 + (x * y)) / t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = x * ((y / t_1) + (t_2 / (x * t_1)));
} else if ((t_3 <= -2e-299) || (!(t_3 <= 0.0) && (t_3 <= 2e+306))) {
tmp = t_3;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = z * (t - a) t_3 = (t_2 + (x * y)) / t_1 tmp = 0 if t_3 <= -math.inf: tmp = x * ((y / t_1) + (t_2 / (x * t_1))) elif (t_3 <= -2e-299) or (not (t_3 <= 0.0) and (t_3 <= 2e+306)): tmp = t_3 else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(z * Float64(t - a)) t_3 = Float64(Float64(t_2 + Float64(x * y)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(y / t_1) + Float64(t_2 / Float64(x * t_1)))); elseif ((t_3 <= -2e-299) || (!(t_3 <= 0.0) && (t_3 <= 2e+306))) tmp = t_3; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = z * (t - a); t_3 = (t_2 + (x * y)) / t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = x * ((y / t_1) + (t_2 / (x * t_1))); elseif ((t_3 <= -2e-299) || (~((t_3 <= 0.0)) && (t_3 <= 2e+306))) tmp = t_3; else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 + N[(x * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(x * N[(N[(y / t$95$1), $MachinePrecision] + N[(t$95$2 / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$3, -2e-299], And[N[Not[LessEqual[t$95$3, 0.0]], $MachinePrecision], LessEqual[t$95$3, 2e+306]]], t$95$3, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := z \cdot \left(t - a\right)\\
t_3 := \frac{t\_2 + x \cdot y}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;x \cdot \left(\frac{y}{t\_1} + \frac{t\_2}{x \cdot t\_1}\right)\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-299} \lor \neg \left(t\_3 \leq 0\right) \land t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 27.6%
Taylor expanded in x around inf 77.5%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999998e-299 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000003e306Initial program 99.6%
if -1.99999999999999998e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 2.00000000000000003e306 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 19.5%
Taylor expanded in z around inf 76.9%
Final simplification90.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -8.2e-58)
t_1
(if (<= z -6.4e-75)
(* a (- (/ x a) (/ z y)))
(if (<= z -1.25e-78)
(/ (* z a) (- (* z (- y b)) y))
(if (<= z 6e-25) x t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -8.2e-58) {
tmp = t_1;
} else if (z <= -6.4e-75) {
tmp = a * ((x / a) - (z / y));
} else if (z <= -1.25e-78) {
tmp = (z * a) / ((z * (y - b)) - y);
} else if (z <= 6e-25) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-8.2d-58)) then
tmp = t_1
else if (z <= (-6.4d-75)) then
tmp = a * ((x / a) - (z / y))
else if (z <= (-1.25d-78)) then
tmp = (z * a) / ((z * (y - b)) - y)
else if (z <= 6d-25) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -8.2e-58) {
tmp = t_1;
} else if (z <= -6.4e-75) {
tmp = a * ((x / a) - (z / y));
} else if (z <= -1.25e-78) {
tmp = (z * a) / ((z * (y - b)) - y);
} else if (z <= 6e-25) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -8.2e-58: tmp = t_1 elif z <= -6.4e-75: tmp = a * ((x / a) - (z / y)) elif z <= -1.25e-78: tmp = (z * a) / ((z * (y - b)) - y) elif z <= 6e-25: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -8.2e-58) tmp = t_1; elseif (z <= -6.4e-75) tmp = Float64(a * Float64(Float64(x / a) - Float64(z / y))); elseif (z <= -1.25e-78) tmp = Float64(Float64(z * a) / Float64(Float64(z * Float64(y - b)) - y)); elseif (z <= 6e-25) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -8.2e-58) tmp = t_1; elseif (z <= -6.4e-75) tmp = a * ((x / a) - (z / y)); elseif (z <= -1.25e-78) tmp = (z * a) / ((z * (y - b)) - y); elseif (z <= 6e-25) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e-58], t$95$1, If[LessEqual[z, -6.4e-75], N[(a * N[(N[(x / a), $MachinePrecision] - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.25e-78], N[(N[(z * a), $MachinePrecision] / N[(N[(z * N[(y - b), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-25], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-75}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - \frac{z}{y}\right)\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-78}:\\
\;\;\;\;\frac{z \cdot a}{z \cdot \left(y - b\right) - y}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-25}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.20000000000000056e-58 or 5.9999999999999995e-25 < z Initial program 54.6%
Taylor expanded in z around inf 80.4%
if -8.20000000000000056e-58 < z < -6.39999999999999953e-75Initial program 86.5%
Taylor expanded in t around 0 86.5%
+-commutative86.5%
mul-1-neg86.5%
unsub-neg86.5%
*-commutative86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in z around 0 73.4%
Taylor expanded in a around inf 86.7%
+-commutative86.7%
mul-1-neg86.7%
unsub-neg86.7%
Simplified86.7%
if -6.39999999999999953e-75 < z < -1.2499999999999999e-78Initial program 100.0%
Taylor expanded in a around inf 100.0%
mul-1-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
Simplified100.0%
if -1.2499999999999999e-78 < z < 5.9999999999999995e-25Initial program 81.5%
Taylor expanded in z around 0 63.3%
Final simplification73.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.45e-17) (not (<= z 0.0085))) (/ (- t a) (- b y)) (/ (- (* x y) (* z a)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.45e-17) || !(z <= 0.0085)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) - (z * a)) / (y + (z * (b - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.45d-17)) .or. (.not. (z <= 0.0085d0))) then
tmp = (t - a) / (b - y)
else
tmp = ((x * y) - (z * a)) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.45e-17) || !(z <= 0.0085)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) - (z * a)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.45e-17) or not (z <= 0.0085): tmp = (t - a) / (b - y) else: tmp = ((x * y) - (z * a)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.45e-17) || !(z <= 0.0085)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) - Float64(z * a)) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.45e-17) || ~((z <= 0.0085))) tmp = (t - a) / (b - y); else tmp = ((x * y) - (z * a)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.45e-17], N[Not[LessEqual[z, 0.0085]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-17} \lor \neg \left(z \leq 0.0085\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot a}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -2.45000000000000006e-17 or 0.0085000000000000006 < z Initial program 51.0%
Taylor expanded in z around inf 83.5%
if -2.45000000000000006e-17 < z < 0.0085000000000000006Initial program 82.9%
Taylor expanded in t around 0 70.6%
+-commutative70.6%
mul-1-neg70.6%
unsub-neg70.6%
*-commutative70.6%
*-commutative70.6%
Simplified70.6%
Final simplification76.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -3.9e-32)
t_1
(if (<= z 3.6e-25) x (if (<= z 1.55e+227) t_1 (/ a (- b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -3.9e-32) {
tmp = t_1;
} else if (z <= 3.6e-25) {
tmp = x;
} else if (z <= 1.55e+227) {
tmp = t_1;
} else {
tmp = a / -b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t / (b - y)
if (z <= (-3.9d-32)) then
tmp = t_1
else if (z <= 3.6d-25) then
tmp = x
else if (z <= 1.55d+227) then
tmp = t_1
else
tmp = a / -b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -3.9e-32) {
tmp = t_1;
} else if (z <= 3.6e-25) {
tmp = x;
} else if (z <= 1.55e+227) {
tmp = t_1;
} else {
tmp = a / -b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -3.9e-32: tmp = t_1 elif z <= 3.6e-25: tmp = x elif z <= 1.55e+227: tmp = t_1 else: tmp = a / -b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -3.9e-32) tmp = t_1; elseif (z <= 3.6e-25) tmp = x; elseif (z <= 1.55e+227) tmp = t_1; else tmp = Float64(a / Float64(-b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -3.9e-32) tmp = t_1; elseif (z <= 3.6e-25) tmp = x; elseif (z <= 1.55e+227) tmp = t_1; else tmp = a / -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.9e-32], t$95$1, If[LessEqual[z, 3.6e-25], x, If[LessEqual[z, 1.55e+227], t$95$1, N[(a / (-b)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-25}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+227}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{-b}\\
\end{array}
\end{array}
if z < -3.9000000000000001e-32 or 3.5999999999999999e-25 < z < 1.5499999999999999e227Initial program 55.4%
Taylor expanded in t around inf 30.5%
*-commutative30.5%
Simplified30.5%
Taylor expanded in z around inf 49.4%
if -3.9000000000000001e-32 < z < 3.5999999999999999e-25Initial program 82.0%
Taylor expanded in z around 0 60.4%
if 1.5499999999999999e227 < z Initial program 43.3%
Taylor expanded in t around 0 43.2%
+-commutative43.2%
mul-1-neg43.2%
unsub-neg43.2%
*-commutative43.2%
*-commutative43.2%
Simplified43.2%
Taylor expanded in y around 0 69.2%
associate-*r/69.2%
neg-mul-169.2%
Simplified69.2%
Final simplification56.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -1.35e-19)
t_1
(if (<= z 3.9e+69)
(/ x (- 1.0 z))
(if (<= z 1.25e+229) t_1 (/ a (- b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -1.35e-19) {
tmp = t_1;
} else if (z <= 3.9e+69) {
tmp = x / (1.0 - z);
} else if (z <= 1.25e+229) {
tmp = t_1;
} else {
tmp = a / -b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t / (b - y)
if (z <= (-1.35d-19)) then
tmp = t_1
else if (z <= 3.9d+69) then
tmp = x / (1.0d0 - z)
else if (z <= 1.25d+229) then
tmp = t_1
else
tmp = a / -b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -1.35e-19) {
tmp = t_1;
} else if (z <= 3.9e+69) {
tmp = x / (1.0 - z);
} else if (z <= 1.25e+229) {
tmp = t_1;
} else {
tmp = a / -b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -1.35e-19: tmp = t_1 elif z <= 3.9e+69: tmp = x / (1.0 - z) elif z <= 1.25e+229: tmp = t_1 else: tmp = a / -b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -1.35e-19) tmp = t_1; elseif (z <= 3.9e+69) tmp = Float64(x / Float64(1.0 - z)); elseif (z <= 1.25e+229) tmp = t_1; else tmp = Float64(a / Float64(-b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -1.35e-19) tmp = t_1; elseif (z <= 3.9e+69) tmp = x / (1.0 - z); elseif (z <= 1.25e+229) tmp = t_1; else tmp = a / -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e-19], t$95$1, If[LessEqual[z, 3.9e+69], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+229], t$95$1, N[(a / (-b)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+69}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+229}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{-b}\\
\end{array}
\end{array}
if z < -1.35e-19 or 3.8999999999999999e69 < z < 1.25000000000000012e229Initial program 48.6%
Taylor expanded in t around inf 30.2%
*-commutative30.2%
Simplified30.2%
Taylor expanded in z around inf 54.4%
if -1.35e-19 < z < 3.8999999999999999e69Initial program 81.6%
Taylor expanded in y around inf 56.4%
mul-1-neg56.4%
unsub-neg56.4%
Simplified56.4%
if 1.25000000000000012e229 < z Initial program 43.3%
Taylor expanded in t around 0 43.2%
+-commutative43.2%
mul-1-neg43.2%
unsub-neg43.2%
*-commutative43.2%
*-commutative43.2%
Simplified43.2%
Taylor expanded in y around 0 69.2%
associate-*r/69.2%
neg-mul-169.2%
Simplified69.2%
Final simplification56.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.9e+196) (/ a y) (if (<= z -2.65e-17) (/ t b) (if (<= z 5.1e-21) x (/ a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.9e+196) {
tmp = a / y;
} else if (z <= -2.65e-17) {
tmp = t / b;
} else if (z <= 5.1e-21) {
tmp = x;
} else {
tmp = a / -b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.9d+196)) then
tmp = a / y
else if (z <= (-2.65d-17)) then
tmp = t / b
else if (z <= 5.1d-21) then
tmp = x
else
tmp = a / -b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.9e+196) {
tmp = a / y;
} else if (z <= -2.65e-17) {
tmp = t / b;
} else if (z <= 5.1e-21) {
tmp = x;
} else {
tmp = a / -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.9e+196: tmp = a / y elif z <= -2.65e-17: tmp = t / b elif z <= 5.1e-21: tmp = x else: tmp = a / -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.9e+196) tmp = Float64(a / y); elseif (z <= -2.65e-17) tmp = Float64(t / b); elseif (z <= 5.1e-21) tmp = x; else tmp = Float64(a / Float64(-b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.9e+196) tmp = a / y; elseif (z <= -2.65e-17) tmp = t / b; elseif (z <= 5.1e-21) tmp = x; else tmp = a / -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.9e+196], N[(a / y), $MachinePrecision], If[LessEqual[z, -2.65e-17], N[(t / b), $MachinePrecision], If[LessEqual[z, 5.1e-21], x, N[(a / (-b)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+196}:\\
\;\;\;\;\frac{a}{y}\\
\mathbf{elif}\;z \leq -2.65 \cdot 10^{-17}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-21}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{-b}\\
\end{array}
\end{array}
if z < -3.9e196Initial program 27.4%
Taylor expanded in t around 0 17.3%
+-commutative17.3%
mul-1-neg17.3%
unsub-neg17.3%
*-commutative17.3%
*-commutative17.3%
Simplified17.3%
Taylor expanded in z around inf 49.5%
associate-*r/49.5%
neg-mul-149.5%
Simplified49.5%
Taylor expanded in b around 0 39.5%
if -3.9e196 < z < -2.6499999999999999e-17Initial program 59.0%
Taylor expanded in x around inf 43.6%
Taylor expanded in b around inf 49.9%
associate-/l*47.5%
associate--l+47.5%
Simplified47.5%
Taylor expanded in t around inf 38.2%
if -2.6499999999999999e-17 < z < 5.10000000000000004e-21Initial program 82.2%
Taylor expanded in z around 0 60.0%
if 5.10000000000000004e-21 < z Initial program 56.9%
Taylor expanded in t around 0 43.7%
+-commutative43.7%
mul-1-neg43.7%
unsub-neg43.7%
*-commutative43.7%
*-commutative43.7%
Simplified43.7%
Taylor expanded in y around 0 38.9%
associate-*r/38.9%
neg-mul-138.9%
Simplified38.9%
Final simplification49.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.8e+197) (/ a y) (if (or (<= z -2.55e-17) (not (<= z 3.4e-25))) (/ t b) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.8e+197) {
tmp = a / y;
} else if ((z <= -2.55e-17) || !(z <= 3.4e-25)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.8d+197)) then
tmp = a / y
else if ((z <= (-2.55d-17)) .or. (.not. (z <= 3.4d-25))) then
tmp = t / b
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.8e+197) {
tmp = a / y;
} else if ((z <= -2.55e-17) || !(z <= 3.4e-25)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.8e+197: tmp = a / y elif (z <= -2.55e-17) or not (z <= 3.4e-25): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.8e+197) tmp = Float64(a / y); elseif ((z <= -2.55e-17) || !(z <= 3.4e-25)) tmp = Float64(t / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.8e+197) tmp = a / y; elseif ((z <= -2.55e-17) || ~((z <= 3.4e-25))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.8e+197], N[(a / y), $MachinePrecision], If[Or[LessEqual[z, -2.55e-17], N[Not[LessEqual[z, 3.4e-25]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+197}:\\
\;\;\;\;\frac{a}{y}\\
\mathbf{elif}\;z \leq -2.55 \cdot 10^{-17} \lor \neg \left(z \leq 3.4 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.79999999999999991e197Initial program 27.4%
Taylor expanded in t around 0 17.3%
+-commutative17.3%
mul-1-neg17.3%
unsub-neg17.3%
*-commutative17.3%
*-commutative17.3%
Simplified17.3%
Taylor expanded in z around inf 49.5%
associate-*r/49.5%
neg-mul-149.5%
Simplified49.5%
Taylor expanded in b around 0 39.5%
if -1.79999999999999991e197 < z < -2.5500000000000001e-17 or 3.40000000000000002e-25 < z Initial program 58.1%
Taylor expanded in x around inf 46.7%
Taylor expanded in b around inf 45.0%
associate-/l*42.6%
associate--l+42.6%
Simplified42.6%
Taylor expanded in t around inf 32.9%
if -2.5500000000000001e-17 < z < 3.40000000000000002e-25Initial program 82.0%
Taylor expanded in z around 0 60.4%
Final simplification47.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.4e-63) (not (<= z 5e-24))) (/ (- t a) (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.4e-63) || !(z <= 5e-24)) {
tmp = (t - a) / (b - y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.4d-63)) .or. (.not. (z <= 5d-24))) then
tmp = (t - a) / (b - y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.4e-63) || !(z <= 5e-24)) {
tmp = (t - a) / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.4e-63) or not (z <= 5e-24): tmp = (t - a) / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.4e-63) || !(z <= 5e-24)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.4e-63) || ~((z <= 5e-24))) tmp = (t - a) / (b - y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.4e-63], N[Not[LessEqual[z, 5e-24]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-63} \lor \neg \left(z \leq 5 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.4000000000000001e-63 or 4.9999999999999998e-24 < z Initial program 54.6%
Taylor expanded in z around inf 80.4%
if -2.4000000000000001e-63 < z < 4.9999999999999998e-24Initial program 82.1%
Taylor expanded in z around 0 61.2%
Final simplification71.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.9e-71) (not (<= y 6.5e+16))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e-71) || !(y <= 6.5e+16)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.9d-71)) .or. (.not. (y <= 6.5d+16))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e-71) || !(y <= 6.5e+16)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.9e-71) or not (y <= 6.5e+16): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.9e-71) || !(y <= 6.5e+16)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.9e-71) || ~((y <= 6.5e+16))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.9e-71], N[Not[LessEqual[y, 6.5e+16]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-71} \lor \neg \left(y \leq 6.5 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -1.89999999999999996e-71 or 6.5e16 < y Initial program 57.3%
Taylor expanded in y around inf 61.1%
mul-1-neg61.1%
unsub-neg61.1%
Simplified61.1%
if -1.89999999999999996e-71 < y < 6.5e16Initial program 81.3%
Taylor expanded in y around 0 62.8%
Final simplification61.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.35) (not (<= z 118000000000.0))) (/ a y) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.35) || !(z <= 118000000000.0)) {
tmp = a / y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-0.35d0)) .or. (.not. (z <= 118000000000.0d0))) then
tmp = a / y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.35) || !(z <= 118000000000.0)) {
tmp = a / y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -0.35) or not (z <= 118000000000.0): tmp = a / y else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -0.35) || !(z <= 118000000000.0)) tmp = Float64(a / y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -0.35) || ~((z <= 118000000000.0))) tmp = a / y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -0.35], N[Not[LessEqual[z, 118000000000.0]], $MachinePrecision]], N[(a / y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.35 \lor \neg \left(z \leq 118000000000\right):\\
\;\;\;\;\frac{a}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -0.34999999999999998 or 1.18e11 < z Initial program 50.5%
Taylor expanded in t around 0 32.2%
+-commutative32.2%
mul-1-neg32.2%
unsub-neg32.2%
*-commutative32.2%
*-commutative32.2%
Simplified32.2%
Taylor expanded in z around inf 44.7%
associate-*r/44.7%
neg-mul-144.7%
Simplified44.7%
Taylor expanded in b around 0 19.4%
if -0.34999999999999998 < z < 1.18e11Initial program 82.2%
Taylor expanded in z around 0 56.0%
Final simplification39.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 67.7%
Taylor expanded in z around 0 31.8%
Final simplification31.8%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024115
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))