
(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 13 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 (* z (- t a)))
(t_3 (/ (+ t_2 (* x y)) t_1)))
(if (<= t_3 (- INFINITY))
(- (/ (- a t) y) (/ x (+ z -1.0)))
(if (<= t_3 -5e-281)
(/ (fma x y t_2) t_1)
(if (or (<= t_3 0.0) (not (<= t_3 INFINITY)))
(+
(/ (+ (/ y (/ (- b y) x)) (/ (- a t) (/ (pow (- b y) 2.0) y))) z)
(/ (- t a) (- b y)))
(+ (* (- t a) (/ z (fma z (- b y) y))) (/ (* x y) t_1)))))))
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 = ((a - t) / y) - (x / (z + -1.0));
} else if (t_3 <= -5e-281) {
tmp = fma(x, y, t_2) / t_1;
} else if ((t_3 <= 0.0) || !(t_3 <= ((double) INFINITY))) {
tmp = (((y / ((b - y) / x)) + ((a - t) / (pow((b - y), 2.0) / y))) / z) + ((t - a) / (b - y));
} else {
tmp = ((t - a) * (z / fma(z, (b - y), y))) + ((x * y) / t_1);
}
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(Float64(Float64(a - t) / y) - Float64(x / Float64(z + -1.0))); elseif (t_3 <= -5e-281) tmp = Float64(fma(x, y, t_2) / t_1); elseif ((t_3 <= 0.0) || !(t_3 <= Inf)) tmp = Float64(Float64(Float64(Float64(y / Float64(Float64(b - y) / x)) + Float64(Float64(a - t) / Float64((Float64(b - y) ^ 2.0) / y))) / z) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(Float64(Float64(t - a) * Float64(z / fma(z, Float64(b - y), y))) + Float64(Float64(x * y) / t_1)); end return 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[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-281], N[(N[(x * y + t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision], If[Or[LessEqual[t$95$3, 0.0], N[Not[LessEqual[t$95$3, Infinity]], $MachinePrecision]], N[(N[(N[(N[(y / N[(N[(b - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(a - t), $MachinePrecision] / N[(N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - a), $MachinePrecision] * N[(z / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / t$95$1), $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:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_3 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t_2\right)}{t_1}\\
\mathbf{elif}\;t_3 \leq 0 \lor \neg \left(t_3 \leq \infty\right):\\
\;\;\;\;\frac{\frac{y}{\frac{b - y}{x}} + \frac{a - t}{\frac{{\left(b - y\right)}^{2}}{y}}}{z} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\left(t - a\right) \cdot \frac{z}{\mathsf{fma}\left(z, b - y, y\right)} + \frac{x \cdot y}{t_1}\\
\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 37.8%
Taylor expanded in y around -inf 51.5%
mul-1-neg51.5%
unsub-neg51.5%
mul-1-neg51.5%
distribute-neg-frac51.5%
cancel-sign-sub-inv51.5%
associate-/l*64.4%
metadata-eval64.4%
*-lft-identity64.4%
associate-/l*67.7%
Simplified67.7%
Taylor expanded in z around inf 73.4%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.9999999999999998e-281Initial program 99.4%
fma-def99.5%
Simplified99.5%
if -4.9999999999999998e-281 < (/.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 9.5%
Taylor expanded in z around -inf 50.3%
+-commutative50.3%
associate--l+50.3%
Simplified98.3%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 78.9%
Taylor expanded in x around inf 78.9%
associate-/l*88.1%
+-commutative88.1%
*-commutative88.1%
fma-udef88.1%
div-inv88.0%
clear-num88.1%
remove-double-div88.1%
Applied egg-rr88.1%
Final simplification92.6%
(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))
(- (/ (- a t) y) (/ x (+ z -1.0)))
(if (<= t_3 -5e-281)
(/ (fma x y t_2) t_1)
(if (or (<= t_3 0.0) (not (<= t_3 1e+260)))
(/ (- t a) (- b y))
(+ (/ (* x y) t_1) (/ t_2 t_1)))))))
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 = ((a - t) / y) - (x / (z + -1.0));
} else if (t_3 <= -5e-281) {
tmp = fma(x, y, t_2) / t_1;
} else if ((t_3 <= 0.0) || !(t_3 <= 1e+260)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) / t_1) + (t_2 / t_1);
}
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(Float64(Float64(a - t) / y) - Float64(x / Float64(z + -1.0))); elseif (t_3 <= -5e-281) tmp = Float64(fma(x, y, t_2) / t_1); elseif ((t_3 <= 0.0) || !(t_3 <= 1e+260)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) / t_1) + Float64(t_2 / t_1)); end return 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[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-281], N[(N[(x * y + t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision], If[Or[LessEqual[t$95$3, 0.0], N[Not[LessEqual[t$95$3, 1e+260]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(t$95$2 / t$95$1), $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:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_3 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t_2\right)}{t_1}\\
\mathbf{elif}\;t_3 \leq 0 \lor \neg \left(t_3 \leq 10^{+260}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t_1} + \frac{t_2}{t_1}\\
\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 37.8%
Taylor expanded in y around -inf 51.5%
mul-1-neg51.5%
unsub-neg51.5%
mul-1-neg51.5%
distribute-neg-frac51.5%
cancel-sign-sub-inv51.5%
associate-/l*64.4%
metadata-eval64.4%
*-lft-identity64.4%
associate-/l*67.7%
Simplified67.7%
Taylor expanded in z around inf 73.4%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.9999999999999998e-281Initial program 99.4%
fma-def99.5%
Simplified99.5%
if -4.9999999999999998e-281 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or 1.00000000000000007e260 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 19.3%
Taylor expanded in z around inf 77.2%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.00000000000000007e260Initial program 99.6%
Taylor expanded in x around inf 99.7%
Final simplification89.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))
(- (/ (- a t) y) (/ x (+ z -1.0)))
(if (<= t_3 -5e-281)
t_3
(if (or (<= t_3 0.0) (not (<= t_3 1e+260)))
(/ (- t a) (- b y))
(+ (/ (* x y) t_1) (/ t_2 t_1)))))))
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 = ((a - t) / y) - (x / (z + -1.0));
} else if (t_3 <= -5e-281) {
tmp = t_3;
} else if ((t_3 <= 0.0) || !(t_3 <= 1e+260)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) / t_1) + (t_2 / t_1);
}
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 = ((a - t) / y) - (x / (z + -1.0));
} else if (t_3 <= -5e-281) {
tmp = t_3;
} else if ((t_3 <= 0.0) || !(t_3 <= 1e+260)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) / t_1) + (t_2 / t_1);
}
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 = ((a - t) / y) - (x / (z + -1.0)) elif t_3 <= -5e-281: tmp = t_3 elif (t_3 <= 0.0) or not (t_3 <= 1e+260): tmp = (t - a) / (b - y) else: tmp = ((x * y) / t_1) + (t_2 / t_1) 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(Float64(Float64(a - t) / y) - Float64(x / Float64(z + -1.0))); elseif (t_3 <= -5e-281) tmp = t_3; elseif ((t_3 <= 0.0) || !(t_3 <= 1e+260)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) / t_1) + Float64(t_2 / t_1)); 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 = ((a - t) / y) - (x / (z + -1.0)); elseif (t_3 <= -5e-281) tmp = t_3; elseif ((t_3 <= 0.0) || ~((t_3 <= 1e+260))) tmp = (t - a) / (b - y); else tmp = ((x * y) / t_1) + (t_2 / t_1); 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[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-281], t$95$3, If[Or[LessEqual[t$95$3, 0.0], N[Not[LessEqual[t$95$3, 1e+260]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(t$95$2 / t$95$1), $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:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_3 \leq -5 \cdot 10^{-281}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_3 \leq 0 \lor \neg \left(t_3 \leq 10^{+260}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t_1} + \frac{t_2}{t_1}\\
\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 37.8%
Taylor expanded in y around -inf 51.5%
mul-1-neg51.5%
unsub-neg51.5%
mul-1-neg51.5%
distribute-neg-frac51.5%
cancel-sign-sub-inv51.5%
associate-/l*64.4%
metadata-eval64.4%
*-lft-identity64.4%
associate-/l*67.7%
Simplified67.7%
Taylor expanded in z around inf 73.4%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.9999999999999998e-281Initial program 99.4%
if -4.9999999999999998e-281 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or 1.00000000000000007e260 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 19.3%
Taylor expanded in z around inf 77.2%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.00000000000000007e260Initial program 99.6%
Taylor expanded in x around inf 99.7%
Final simplification89.0%
(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))
(- (/ (- a t) y) (/ x (+ z -1.0)))
(if (or (<= t_1 -5e-281) (and (not (<= t_1 0.0)) (<= t_1 1e+260)))
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 = ((a - t) / y) - (x / (z + -1.0));
} else if ((t_1 <= -5e-281) || (!(t_1 <= 0.0) && (t_1 <= 1e+260))) {
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 = ((a - t) / y) - (x / (z + -1.0));
} else if ((t_1 <= -5e-281) || (!(t_1 <= 0.0) && (t_1 <= 1e+260))) {
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 = ((a - t) / y) - (x / (z + -1.0)) elif (t_1 <= -5e-281) or (not (t_1 <= 0.0) and (t_1 <= 1e+260)): 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(Float64(Float64(a - t) / y) - Float64(x / Float64(z + -1.0))); elseif ((t_1 <= -5e-281) || (!(t_1 <= 0.0) && (t_1 <= 1e+260))) 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 = ((a - t) / y) - (x / (z + -1.0)); elseif ((t_1 <= -5e-281) || (~((t_1 <= 0.0)) && (t_1 <= 1e+260))) 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[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -5e-281], And[N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision], LessEqual[t$95$1, 1e+260]]], 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:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-281} \lor \neg \left(t_1 \leq 0\right) \land t_1 \leq 10^{+260}:\\
\;\;\;\;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 37.8%
Taylor expanded in y around -inf 51.5%
mul-1-neg51.5%
unsub-neg51.5%
mul-1-neg51.5%
distribute-neg-frac51.5%
cancel-sign-sub-inv51.5%
associate-/l*64.4%
metadata-eval64.4%
*-lft-identity64.4%
associate-/l*67.7%
Simplified67.7%
Taylor expanded in z around inf 73.4%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.9999999999999998e-281 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.00000000000000007e260Initial program 99.5%
if -4.9999999999999998e-281 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or 1.00000000000000007e260 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 19.3%
Taylor expanded in z around inf 77.2%
Final simplification88.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3e+33) (not (<= z 450.0))) (/ (- t a) (- b y)) (/ (+ (* x y) (* z t)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3e+33) || !(z <= 450.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * t)) / (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 <= (-3d+33)) .or. (.not. (z <= 450.0d0))) then
tmp = (t - a) / (b - y)
else
tmp = ((x * y) + (z * t)) / (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 <= -3e+33) || !(z <= 450.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * t)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3e+33) or not (z <= 450.0): tmp = (t - a) / (b - y) else: tmp = ((x * y) + (z * t)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3e+33) || !(z <= 450.0)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) / 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 <= -3e+33) || ~((z <= 450.0))) tmp = (t - a) / (b - y); else tmp = ((x * y) + (z * t)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3e+33], N[Not[LessEqual[z, 450.0]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+33} \lor \neg \left(z \leq 450\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot t}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -2.99999999999999984e33 or 450 < z Initial program 45.7%
Taylor expanded in z around inf 81.4%
if -2.99999999999999984e33 < z < 450Initial program 85.6%
Taylor expanded in a around 0 71.2%
Final simplification76.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.00062) (not (<= z 0.95))) (/ (- t a) (- b y)) (/ (+ (* x y) (* z t)) (+ y (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.00062) || !(z <= 0.95)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * t)) / (y + (z * 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 <= (-0.00062d0)) .or. (.not. (z <= 0.95d0))) then
tmp = (t - a) / (b - y)
else
tmp = ((x * y) + (z * t)) / (y + (z * 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 <= -0.00062) || !(z <= 0.95)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * t)) / (y + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -0.00062) or not (z <= 0.95): tmp = (t - a) / (b - y) else: tmp = ((x * y) + (z * t)) / (y + (z * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -0.00062) || !(z <= 0.95)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) / Float64(y + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -0.00062) || ~((z <= 0.95))) tmp = (t - a) / (b - y); else tmp = ((x * y) + (z * t)) / (y + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -0.00062], N[Not[LessEqual[z, 0.95]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00062 \lor \neg \left(z \leq 0.95\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot t}{y + z \cdot b}\\
\end{array}
\end{array}
if z < -6.2e-4 or 0.94999999999999996 < z Initial program 47.8%
Taylor expanded in z around inf 79.9%
if -6.2e-4 < z < 0.94999999999999996Initial program 85.5%
Taylor expanded in a around 0 71.1%
Taylor expanded in b around inf 70.4%
Final simplification75.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.2e-29) (not (<= z 2.6e-7))) (/ (- t a) (- b y)) (+ x (* z (/ t y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.2e-29) || !(z <= 2.6e-7)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + (z * (t / 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 <= (-8.2d-29)) .or. (.not. (z <= 2.6d-7))) then
tmp = (t - a) / (b - y)
else
tmp = x + (z * (t / 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 <= -8.2e-29) || !(z <= 2.6e-7)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + (z * (t / y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.2e-29) or not (z <= 2.6e-7): tmp = (t - a) / (b - y) else: tmp = x + (z * (t / y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.2e-29) || !(z <= 2.6e-7)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(z * Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.2e-29) || ~((z <= 2.6e-7))) tmp = (t - a) / (b - y); else tmp = x + (z * (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.2e-29], N[Not[LessEqual[z, 2.6e-7]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-29} \lor \neg \left(z \leq 2.6 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t}{y}\\
\end{array}
\end{array}
if z < -8.1999999999999996e-29 or 2.59999999999999999e-7 < z Initial program 48.9%
Taylor expanded in z around inf 79.0%
if -8.1999999999999996e-29 < z < 2.59999999999999999e-7Initial program 85.2%
Taylor expanded in z around 0 54.9%
Taylor expanded in t around inf 65.2%
Final simplification72.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -9.8e-27) (/ t (- b y)) (if (<= z 6.8e-7) (+ x (* z (/ t y))) (/ (- t a) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.8e-27) {
tmp = t / (b - y);
} else if (z <= 6.8e-7) {
tmp = x + (z * (t / y));
} 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 (z <= (-9.8d-27)) then
tmp = t / (b - y)
else if (z <= 6.8d-7) then
tmp = x + (z * (t / y))
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 (z <= -9.8e-27) {
tmp = t / (b - y);
} else if (z <= 6.8e-7) {
tmp = x + (z * (t / y));
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -9.8e-27: tmp = t / (b - y) elif z <= 6.8e-7: tmp = x + (z * (t / y)) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -9.8e-27) tmp = Float64(t / Float64(b - y)); elseif (z <= 6.8e-7) tmp = Float64(x + Float64(z * Float64(t / y))); 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 (z <= -9.8e-27) tmp = t / (b - y); elseif (z <= 6.8e-7) tmp = x + (z * (t / y)); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -9.8e-27], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e-7], N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{-27}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-7}:\\
\;\;\;\;x + z \cdot \frac{t}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if z < -9.79999999999999952e-27Initial program 51.5%
Taylor expanded in a around 0 36.1%
Taylor expanded in z around inf 48.1%
if -9.79999999999999952e-27 < z < 6.79999999999999948e-7Initial program 85.2%
Taylor expanded in z around 0 54.9%
Taylor expanded in t around inf 65.2%
if 6.79999999999999948e-7 < z Initial program 45.7%
Taylor expanded in y around 0 48.1%
Final simplification55.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.00146) (not (<= z 460.0))) (/ t (- b y)) (+ x (* x z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.00146) || !(z <= 460.0)) {
tmp = t / (b - y);
} else {
tmp = x + (x * z);
}
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.00146d0)) .or. (.not. (z <= 460.0d0))) then
tmp = t / (b - y)
else
tmp = x + (x * z)
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.00146) || !(z <= 460.0)) {
tmp = t / (b - y);
} else {
tmp = x + (x * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -0.00146) or not (z <= 460.0): tmp = t / (b - y) else: tmp = x + (x * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -0.00146) || !(z <= 460.0)) tmp = Float64(t / Float64(b - y)); else tmp = Float64(x + Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -0.00146) || ~((z <= 460.0))) tmp = t / (b - y); else tmp = x + (x * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -0.00146], N[Not[LessEqual[z, 460.0]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00146 \lor \neg \left(z \leq 460\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot z\\
\end{array}
\end{array}
if z < -0.0014599999999999999 or 460 < z Initial program 47.0%
Taylor expanded in a around 0 35.4%
Taylor expanded in z around inf 48.3%
if -0.0014599999999999999 < z < 460Initial program 85.8%
Taylor expanded in y around inf 52.4%
+-commutative52.4%
mul-1-neg52.4%
unsub-neg52.4%
Simplified52.4%
Taylor expanded in z around 0 52.5%
Final simplification50.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.15e-45) (not (<= y 8.5e-10))) (/ 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.15e-45) || !(y <= 8.5e-10)) {
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.15d-45)) .or. (.not. (y <= 8.5d-10))) 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.15e-45) || !(y <= 8.5e-10)) {
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.15e-45) or not (y <= 8.5e-10): 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.15e-45) || !(y <= 8.5e-10)) 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.15e-45) || ~((y <= 8.5e-10))) 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.15e-45], N[Not[LessEqual[y, 8.5e-10]], $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.15 \cdot 10^{-45} \lor \neg \left(y \leq 8.5 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -1.14999999999999996e-45 or 8.4999999999999996e-10 < y Initial program 56.7%
Taylor expanded in y around inf 48.8%
+-commutative48.8%
mul-1-neg48.8%
unsub-neg48.8%
Simplified48.8%
if -1.14999999999999996e-45 < y < 8.4999999999999996e-10Initial program 78.0%
Taylor expanded in y around 0 60.5%
Final simplification53.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -0.0074) (/ t b) (if (<= z 460.0) (+ x (* x z)) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.0074) {
tmp = t / b;
} else if (z <= 460.0) {
tmp = x + (x * z);
} else {
tmp = t / 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 <= (-0.0074d0)) then
tmp = t / b
else if (z <= 460.0d0) then
tmp = x + (x * z)
else
tmp = t / 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 <= -0.0074) {
tmp = t / b;
} else if (z <= 460.0) {
tmp = x + (x * z);
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -0.0074: tmp = t / b elif z <= 460.0: tmp = x + (x * z) else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -0.0074) tmp = Float64(t / b); elseif (z <= 460.0) tmp = Float64(x + Float64(x * z)); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -0.0074) tmp = t / b; elseif (z <= 460.0) tmp = x + (x * z); else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -0.0074], N[(t / b), $MachinePrecision], If[LessEqual[z, 460.0], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0074:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 460:\\
\;\;\;\;x + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -0.0074000000000000003 or 460 < z Initial program 47.0%
Taylor expanded in a around 0 35.4%
Taylor expanded in y around 0 30.0%
if -0.0074000000000000003 < z < 460Initial program 85.8%
Taylor expanded in y around inf 52.4%
+-commutative52.4%
mul-1-neg52.4%
unsub-neg52.4%
Simplified52.4%
Taylor expanded in z around 0 52.5%
Final simplification40.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -0.002) (/ t b) (if (<= z 680.0) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.002) {
tmp = t / b;
} else if (z <= 680.0) {
tmp = x;
} else {
tmp = t / 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 <= (-0.002d0)) then
tmp = t / b
else if (z <= 680.0d0) then
tmp = x
else
tmp = t / 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 <= -0.002) {
tmp = t / b;
} else if (z <= 680.0) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -0.002: tmp = t / b elif z <= 680.0: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -0.002) tmp = Float64(t / b); elseif (z <= 680.0) tmp = x; else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -0.002) tmp = t / b; elseif (z <= 680.0) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -0.002], N[(t / b), $MachinePrecision], If[LessEqual[z, 680.0], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.002:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 680:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -2e-3 or 680 < z Initial program 47.0%
Taylor expanded in a around 0 35.4%
Taylor expanded in y around 0 30.0%
if -2e-3 < z < 680Initial program 85.8%
Taylor expanded in z around 0 51.8%
Final simplification40.3%
(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 65.3%
Taylor expanded in z around 0 26.4%
Final simplification26.4%
(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 2023187
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:herbie-target
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))