
(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 16 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 (+ (/ 1.0 (* (/ (- b y) y) (/ z x))) (/ (- t a) (- b y))))
(t_2 (* z (- t a)))
(t_3 (fma z (- b y) y)))
(if (<= z -7600.0)
t_1
(if (<= z 7e-268)
(/ (fma x y t_2) t_3)
(if (<= z 3.9e-100)
(+ (/ y (/ t_3 x)) (* z (/ t t_3)))
(if (<= z 1.2e+14) (/ (+ t_2 (* y x)) (+ y (* z (- b y)))) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y));
double t_2 = z * (t - a);
double t_3 = fma(z, (b - y), y);
double tmp;
if (z <= -7600.0) {
tmp = t_1;
} else if (z <= 7e-268) {
tmp = fma(x, y, t_2) / t_3;
} else if (z <= 3.9e-100) {
tmp = (y / (t_3 / x)) + (z * (t / t_3));
} else if (z <= 1.2e+14) {
tmp = (t_2 + (y * x)) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 / Float64(Float64(Float64(b - y) / y) * Float64(z / x))) + Float64(Float64(t - a) / Float64(b - y))) t_2 = Float64(z * Float64(t - a)) t_3 = fma(z, Float64(b - y), y) tmp = 0.0 if (z <= -7600.0) tmp = t_1; elseif (z <= 7e-268) tmp = Float64(fma(x, y, t_2) / t_3); elseif (z <= 3.9e-100) tmp = Float64(Float64(y / Float64(t_3 / x)) + Float64(z * Float64(t / t_3))); elseif (z <= 1.2e+14) tmp = Float64(Float64(t_2 + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 / N[(N[(N[(b - y), $MachinePrecision] / y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[z, -7600.0], t$95$1, If[LessEqual[z, 7e-268], N[(N[(x * y + t$95$2), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[z, 3.9e-100], N[(N[(y / N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(t / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+14], N[(N[(t$95$2 + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{b - y}{y} \cdot \frac{z}{x}} + \frac{t - a}{b - y}\\
t_2 := z \cdot \left(t - a\right)\\
t_3 := \mathsf{fma}\left(z, b - y, y\right)\\
\mathbf{if}\;z \leq -7600:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-268}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t_2\right)}{t_3}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-100}:\\
\;\;\;\;\frac{y}{\frac{t_3}{x}} + z \cdot \frac{t}{t_3}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{t_2 + y \cdot x}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7600 or 1.2e14 < z Initial program 40.7%
Taylor expanded in z around -inf 69.0%
+-commutative69.0%
associate--l+68.9%
Simplified84.6%
Taylor expanded in x around inf 85.3%
clear-num85.3%
inv-pow85.3%
Applied egg-rr85.3%
unpow-185.3%
times-frac99.9%
Simplified99.9%
if -7600 < z < 7.00000000000000011e-268Initial program 94.8%
fma-def94.8%
+-commutative94.8%
fma-def94.8%
Simplified94.8%
if 7.00000000000000011e-268 < z < 3.89999999999999977e-100Initial program 68.7%
Taylor expanded in x around inf 68.8%
Taylor expanded in a around 0 62.8%
associate-/l*90.7%
+-commutative90.7%
*-commutative90.7%
fma-def90.7%
associate-/l*87.6%
+-commutative87.6%
*-commutative87.6%
fma-def87.6%
associate-/r/87.7%
Simplified87.7%
if 3.89999999999999977e-100 < z < 1.2e14Initial program 92.1%
Final simplification96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (+ (/ 1.0 (* (/ (- b y) y) (/ z x))) (/ (- t a) (- b y))))
(t_3 (* z (- t a))))
(if (<= z -7200.0)
t_2
(if (<= z 8e-291)
(/ (fma x y t_3) (fma z (- b y) y))
(if (<= z 1.3e-101)
(+ x (/ t_3 t_1))
(if (<= z 1.2e+14) (/ (+ t_3 (* y x)) t_1) 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 = (1.0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y));
double t_3 = z * (t - a);
double tmp;
if (z <= -7200.0) {
tmp = t_2;
} else if (z <= 8e-291) {
tmp = fma(x, y, t_3) / fma(z, (b - y), y);
} else if (z <= 1.3e-101) {
tmp = x + (t_3 / t_1);
} else if (z <= 1.2e+14) {
tmp = (t_3 + (y * x)) / t_1;
} 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(1.0 / Float64(Float64(Float64(b - y) / y) * Float64(z / x))) + Float64(Float64(t - a) / Float64(b - y))) t_3 = Float64(z * Float64(t - a)) tmp = 0.0 if (z <= -7200.0) tmp = t_2; elseif (z <= 8e-291) tmp = Float64(fma(x, y, t_3) / fma(z, Float64(b - y), y)); elseif (z <= 1.3e-101) tmp = Float64(x + Float64(t_3 / t_1)); elseif (z <= 1.2e+14) tmp = Float64(Float64(t_3 + Float64(y * x)) / t_1); else tmp = t_2; 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[(N[(1.0 / N[(N[(N[(b - y), $MachinePrecision] / y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7200.0], t$95$2, If[LessEqual[z, 8e-291], N[(N[(x * y + t$95$3), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-101], N[(x + N[(t$95$3 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+14], N[(N[(t$95$3 + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{1}{\frac{b - y}{y} \cdot \frac{z}{x}} + \frac{t - a}{b - y}\\
t_3 := z \cdot \left(t - a\right)\\
\mathbf{if}\;z \leq -7200:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-291}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t_3\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-101}:\\
\;\;\;\;x + \frac{t_3}{t_1}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{t_3 + y \cdot x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -7200 or 1.2e14 < z Initial program 40.7%
Taylor expanded in z around -inf 69.0%
+-commutative69.0%
associate--l+68.9%
Simplified84.6%
Taylor expanded in x around inf 85.3%
clear-num85.3%
inv-pow85.3%
Applied egg-rr85.3%
unpow-185.3%
times-frac99.9%
Simplified99.9%
if -7200 < z < 7.9999999999999997e-291Initial program 93.8%
fma-def93.9%
+-commutative93.9%
fma-def93.9%
Simplified93.9%
if 7.9999999999999997e-291 < z < 1.3000000000000001e-101Initial program 79.1%
Taylor expanded in x around inf 79.1%
Taylor expanded in z around 0 93.1%
if 1.3000000000000001e-101 < z < 1.2e14Initial program 88.6%
Final simplification96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ 1.0 (* (/ (- b y) y) (/ z x))) (/ (- t a) (- b y))))
(t_2 (* z (- t a)))
(t_3 (+ y (* z (- b y))))
(t_4 (/ t_2 t_3)))
(if (<= z -7600.0)
t_1
(if (<= z 7.4e-291)
(+ t_4 (/ (* y x) t_3))
(if (<= z 9.2e-101)
(+ x t_4)
(if (<= z 1.2e+14) (/ (+ t_2 (* y x)) t_3) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y));
double t_2 = z * (t - a);
double t_3 = y + (z * (b - y));
double t_4 = t_2 / t_3;
double tmp;
if (z <= -7600.0) {
tmp = t_1;
} else if (z <= 7.4e-291) {
tmp = t_4 + ((y * x) / t_3);
} else if (z <= 9.2e-101) {
tmp = x + t_4;
} else if (z <= 1.2e+14) {
tmp = (t_2 + (y * x)) / t_3;
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (1.0d0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y))
t_2 = z * (t - a)
t_3 = y + (z * (b - y))
t_4 = t_2 / t_3
if (z <= (-7600.0d0)) then
tmp = t_1
else if (z <= 7.4d-291) then
tmp = t_4 + ((y * x) / t_3)
else if (z <= 9.2d-101) then
tmp = x + t_4
else if (z <= 1.2d+14) then
tmp = (t_2 + (y * x)) / t_3
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 = (1.0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y));
double t_2 = z * (t - a);
double t_3 = y + (z * (b - y));
double t_4 = t_2 / t_3;
double tmp;
if (z <= -7600.0) {
tmp = t_1;
} else if (z <= 7.4e-291) {
tmp = t_4 + ((y * x) / t_3);
} else if (z <= 9.2e-101) {
tmp = x + t_4;
} else if (z <= 1.2e+14) {
tmp = (t_2 + (y * x)) / t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y)) t_2 = z * (t - a) t_3 = y + (z * (b - y)) t_4 = t_2 / t_3 tmp = 0 if z <= -7600.0: tmp = t_1 elif z <= 7.4e-291: tmp = t_4 + ((y * x) / t_3) elif z <= 9.2e-101: tmp = x + t_4 elif z <= 1.2e+14: tmp = (t_2 + (y * x)) / t_3 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 / Float64(Float64(Float64(b - y) / y) * Float64(z / x))) + Float64(Float64(t - a) / Float64(b - y))) t_2 = Float64(z * Float64(t - a)) t_3 = Float64(y + Float64(z * Float64(b - y))) t_4 = Float64(t_2 / t_3) tmp = 0.0 if (z <= -7600.0) tmp = t_1; elseif (z <= 7.4e-291) tmp = Float64(t_4 + Float64(Float64(y * x) / t_3)); elseif (z <= 9.2e-101) tmp = Float64(x + t_4); elseif (z <= 1.2e+14) tmp = Float64(Float64(t_2 + Float64(y * x)) / t_3); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y)); t_2 = z * (t - a); t_3 = y + (z * (b - y)); t_4 = t_2 / t_3; tmp = 0.0; if (z <= -7600.0) tmp = t_1; elseif (z <= 7.4e-291) tmp = t_4 + ((y * x) / t_3); elseif (z <= 9.2e-101) tmp = x + t_4; elseif (z <= 1.2e+14) tmp = (t_2 + (y * x)) / t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 / N[(N[(N[(b - y), $MachinePrecision] / y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 / t$95$3), $MachinePrecision]}, If[LessEqual[z, -7600.0], t$95$1, If[LessEqual[z, 7.4e-291], N[(t$95$4 + N[(N[(y * x), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e-101], N[(x + t$95$4), $MachinePrecision], If[LessEqual[z, 1.2e+14], N[(N[(t$95$2 + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{b - y}{y} \cdot \frac{z}{x}} + \frac{t - a}{b - y}\\
t_2 := z \cdot \left(t - a\right)\\
t_3 := y + z \cdot \left(b - y\right)\\
t_4 := \frac{t_2}{t_3}\\
\mathbf{if}\;z \leq -7600:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-291}:\\
\;\;\;\;t_4 + \frac{y \cdot x}{t_3}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-101}:\\
\;\;\;\;x + t_4\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{t_2 + y \cdot x}{t_3}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7600 or 1.2e14 < z Initial program 40.7%
Taylor expanded in z around -inf 69.0%
+-commutative69.0%
associate--l+68.9%
Simplified84.6%
Taylor expanded in x around inf 85.3%
clear-num85.3%
inv-pow85.3%
Applied egg-rr85.3%
unpow-185.3%
times-frac99.9%
Simplified99.9%
if -7600 < z < 7.4000000000000001e-291Initial program 93.8%
Taylor expanded in x around inf 93.9%
if 7.4000000000000001e-291 < z < 9.1999999999999998e-101Initial program 79.1%
Taylor expanded in x around inf 79.1%
Taylor expanded in z around 0 93.1%
if 9.1999999999999998e-101 < z < 1.2e14Initial program 88.6%
Final simplification96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ 1.0 (* (/ (- b y) y) (/ z x))) (/ (- t a) (- b y))))
(t_2 (* z (- t a)))
(t_3 (+ y (* z (- b y))))
(t_4 (/ (+ t_2 (* y x)) t_3)))
(if (<= z -7600.0)
t_1
(if (<= z 5.4e-291)
t_4
(if (<= z 1.6e-101) (+ x (/ t_2 t_3)) (if (<= z 3.4e+14) t_4 t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y));
double t_2 = z * (t - a);
double t_3 = y + (z * (b - y));
double t_4 = (t_2 + (y * x)) / t_3;
double tmp;
if (z <= -7600.0) {
tmp = t_1;
} else if (z <= 5.4e-291) {
tmp = t_4;
} else if (z <= 1.6e-101) {
tmp = x + (t_2 / t_3);
} else if (z <= 3.4e+14) {
tmp = t_4;
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (1.0d0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y))
t_2 = z * (t - a)
t_3 = y + (z * (b - y))
t_4 = (t_2 + (y * x)) / t_3
if (z <= (-7600.0d0)) then
tmp = t_1
else if (z <= 5.4d-291) then
tmp = t_4
else if (z <= 1.6d-101) then
tmp = x + (t_2 / t_3)
else if (z <= 3.4d+14) then
tmp = t_4
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 = (1.0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y));
double t_2 = z * (t - a);
double t_3 = y + (z * (b - y));
double t_4 = (t_2 + (y * x)) / t_3;
double tmp;
if (z <= -7600.0) {
tmp = t_1;
} else if (z <= 5.4e-291) {
tmp = t_4;
} else if (z <= 1.6e-101) {
tmp = x + (t_2 / t_3);
} else if (z <= 3.4e+14) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y)) t_2 = z * (t - a) t_3 = y + (z * (b - y)) t_4 = (t_2 + (y * x)) / t_3 tmp = 0 if z <= -7600.0: tmp = t_1 elif z <= 5.4e-291: tmp = t_4 elif z <= 1.6e-101: tmp = x + (t_2 / t_3) elif z <= 3.4e+14: tmp = t_4 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 / Float64(Float64(Float64(b - y) / y) * Float64(z / x))) + Float64(Float64(t - a) / Float64(b - y))) t_2 = Float64(z * Float64(t - a)) t_3 = Float64(y + Float64(z * Float64(b - y))) t_4 = Float64(Float64(t_2 + Float64(y * x)) / t_3) tmp = 0.0 if (z <= -7600.0) tmp = t_1; elseif (z <= 5.4e-291) tmp = t_4; elseif (z <= 1.6e-101) tmp = Float64(x + Float64(t_2 / t_3)); elseif (z <= 3.4e+14) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 / (((b - y) / y) * (z / x))) + ((t - a) / (b - y)); t_2 = z * (t - a); t_3 = y + (z * (b - y)); t_4 = (t_2 + (y * x)) / t_3; tmp = 0.0; if (z <= -7600.0) tmp = t_1; elseif (z <= 5.4e-291) tmp = t_4; elseif (z <= 1.6e-101) tmp = x + (t_2 / t_3); elseif (z <= 3.4e+14) tmp = t_4; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 / N[(N[(N[(b - y), $MachinePrecision] / y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$2 + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[z, -7600.0], t$95$1, If[LessEqual[z, 5.4e-291], t$95$4, If[LessEqual[z, 1.6e-101], N[(x + N[(t$95$2 / t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+14], t$95$4, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{b - y}{y} \cdot \frac{z}{x}} + \frac{t - a}{b - y}\\
t_2 := z \cdot \left(t - a\right)\\
t_3 := y + z \cdot \left(b - y\right)\\
t_4 := \frac{t_2 + y \cdot x}{t_3}\\
\mathbf{if}\;z \leq -7600:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-291}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-101}:\\
\;\;\;\;x + \frac{t_2}{t_3}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+14}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7600 or 3.4e14 < z Initial program 40.7%
Taylor expanded in z around -inf 69.0%
+-commutative69.0%
associate--l+68.9%
Simplified84.6%
Taylor expanded in x around inf 85.3%
clear-num85.3%
inv-pow85.3%
Applied egg-rr85.3%
unpow-185.3%
times-frac99.9%
Simplified99.9%
if -7600 < z < 5.39999999999999983e-291 or 1.59999999999999989e-101 < z < 3.4e14Initial program 92.3%
if 5.39999999999999983e-291 < z < 1.59999999999999989e-101Initial program 79.1%
Taylor expanded in x around inf 79.1%
Taylor expanded in z around 0 93.1%
Final simplification96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- b y)))
(t_2 (+ (/ (- t a) (- b y)) (/ (* y x) t_1)))
(t_3 (* z (- t a)))
(t_4 (/ (+ t_3 (* y x)) (+ y (* z b)))))
(if (<= z -0.62)
t_2
(if (<= z 1.16e-290)
t_4
(if (<= z 9.2e-101) (+ x (/ t_3 (+ y t_1))) (if (<= z 1.0) t_4 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (b - y);
double t_2 = ((t - a) / (b - y)) + ((y * x) / t_1);
double t_3 = z * (t - a);
double t_4 = (t_3 + (y * x)) / (y + (z * b));
double tmp;
if (z <= -0.62) {
tmp = t_2;
} else if (z <= 1.16e-290) {
tmp = t_4;
} else if (z <= 9.2e-101) {
tmp = x + (t_3 / (y + t_1));
} else if (z <= 1.0) {
tmp = t_4;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = z * (b - y)
t_2 = ((t - a) / (b - y)) + ((y * x) / t_1)
t_3 = z * (t - a)
t_4 = (t_3 + (y * x)) / (y + (z * b))
if (z <= (-0.62d0)) then
tmp = t_2
else if (z <= 1.16d-290) then
tmp = t_4
else if (z <= 9.2d-101) then
tmp = x + (t_3 / (y + t_1))
else if (z <= 1.0d0) then
tmp = t_4
else
tmp = t_2
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 = z * (b - y);
double t_2 = ((t - a) / (b - y)) + ((y * x) / t_1);
double t_3 = z * (t - a);
double t_4 = (t_3 + (y * x)) / (y + (z * b));
double tmp;
if (z <= -0.62) {
tmp = t_2;
} else if (z <= 1.16e-290) {
tmp = t_4;
} else if (z <= 9.2e-101) {
tmp = x + (t_3 / (y + t_1));
} else if (z <= 1.0) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (b - y) t_2 = ((t - a) / (b - y)) + ((y * x) / t_1) t_3 = z * (t - a) t_4 = (t_3 + (y * x)) / (y + (z * b)) tmp = 0 if z <= -0.62: tmp = t_2 elif z <= 1.16e-290: tmp = t_4 elif z <= 9.2e-101: tmp = x + (t_3 / (y + t_1)) elif z <= 1.0: tmp = t_4 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(b - y)) t_2 = Float64(Float64(Float64(t - a) / Float64(b - y)) + Float64(Float64(y * x) / t_1)) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(t_3 + Float64(y * x)) / Float64(y + Float64(z * b))) tmp = 0.0 if (z <= -0.62) tmp = t_2; elseif (z <= 1.16e-290) tmp = t_4; elseif (z <= 9.2e-101) tmp = Float64(x + Float64(t_3 / Float64(y + t_1))); elseif (z <= 1.0) tmp = t_4; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (b - y); t_2 = ((t - a) / (b - y)) + ((y * x) / t_1); t_3 = z * (t - a); t_4 = (t_3 + (y * x)) / (y + (z * b)); tmp = 0.0; if (z <= -0.62) tmp = t_2; elseif (z <= 1.16e-290) tmp = t_4; elseif (z <= 9.2e-101) tmp = x + (t_3 / (y + t_1)); elseif (z <= 1.0) tmp = t_4; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.62], t$95$2, If[LessEqual[z, 1.16e-290], t$95$4, If[LessEqual[z, 9.2e-101], N[(x + N[(t$95$3 / N[(y + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], t$95$4, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b - y\right)\\
t_2 := \frac{t - a}{b - y} + \frac{y \cdot x}{t_1}\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{t_3 + y \cdot x}{y + z \cdot b}\\
\mathbf{if}\;z \leq -0.62:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-290}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-101}:\\
\;\;\;\;x + \frac{t_3}{y + t_1}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -0.619999999999999996 or 1 < z Initial program 42.1%
Taylor expanded in z around -inf 68.3%
+-commutative68.3%
associate--l+68.3%
Simplified83.8%
Taylor expanded in x around inf 84.4%
if -0.619999999999999996 < z < 1.16000000000000001e-290 or 9.1999999999999998e-101 < z < 1Initial program 92.1%
Taylor expanded in b around inf 89.7%
if 1.16000000000000001e-290 < z < 9.1999999999999998e-101Initial program 79.1%
Taylor expanded in x around inf 79.1%
Taylor expanded in z around 0 93.1%
Final simplification87.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- b y)))
(t_2 (+ (/ (- t a) (- b y)) (/ (* y x) t_1)))
(t_3 (* z (- t a)))
(t_4 (+ y t_1))
(t_5 (/ (+ t_3 (* y x)) t_4)))
(if (<= z -7600.0)
t_2
(if (<= z 1.3e-290)
t_5
(if (<= z 1.06e-101) (+ x (/ t_3 t_4)) (if (<= z 5.5e+14) t_5 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (b - y);
double t_2 = ((t - a) / (b - y)) + ((y * x) / t_1);
double t_3 = z * (t - a);
double t_4 = y + t_1;
double t_5 = (t_3 + (y * x)) / t_4;
double tmp;
if (z <= -7600.0) {
tmp = t_2;
} else if (z <= 1.3e-290) {
tmp = t_5;
} else if (z <= 1.06e-101) {
tmp = x + (t_3 / t_4);
} else if (z <= 5.5e+14) {
tmp = t_5;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = z * (b - y)
t_2 = ((t - a) / (b - y)) + ((y * x) / t_1)
t_3 = z * (t - a)
t_4 = y + t_1
t_5 = (t_3 + (y * x)) / t_4
if (z <= (-7600.0d0)) then
tmp = t_2
else if (z <= 1.3d-290) then
tmp = t_5
else if (z <= 1.06d-101) then
tmp = x + (t_3 / t_4)
else if (z <= 5.5d+14) then
tmp = t_5
else
tmp = t_2
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 = z * (b - y);
double t_2 = ((t - a) / (b - y)) + ((y * x) / t_1);
double t_3 = z * (t - a);
double t_4 = y + t_1;
double t_5 = (t_3 + (y * x)) / t_4;
double tmp;
if (z <= -7600.0) {
tmp = t_2;
} else if (z <= 1.3e-290) {
tmp = t_5;
} else if (z <= 1.06e-101) {
tmp = x + (t_3 / t_4);
} else if (z <= 5.5e+14) {
tmp = t_5;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (b - y) t_2 = ((t - a) / (b - y)) + ((y * x) / t_1) t_3 = z * (t - a) t_4 = y + t_1 t_5 = (t_3 + (y * x)) / t_4 tmp = 0 if z <= -7600.0: tmp = t_2 elif z <= 1.3e-290: tmp = t_5 elif z <= 1.06e-101: tmp = x + (t_3 / t_4) elif z <= 5.5e+14: tmp = t_5 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(b - y)) t_2 = Float64(Float64(Float64(t - a) / Float64(b - y)) + Float64(Float64(y * x) / t_1)) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(y + t_1) t_5 = Float64(Float64(t_3 + Float64(y * x)) / t_4) tmp = 0.0 if (z <= -7600.0) tmp = t_2; elseif (z <= 1.3e-290) tmp = t_5; elseif (z <= 1.06e-101) tmp = Float64(x + Float64(t_3 / t_4)); elseif (z <= 5.5e+14) tmp = t_5; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (b - y); t_2 = ((t - a) / (b - y)) + ((y * x) / t_1); t_3 = z * (t - a); t_4 = y + t_1; t_5 = (t_3 + (y * x)) / t_4; tmp = 0.0; if (z <= -7600.0) tmp = t_2; elseif (z <= 1.3e-290) tmp = t_5; elseif (z <= 1.06e-101) tmp = x + (t_3 / t_4); elseif (z <= 5.5e+14) tmp = t_5; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(y + t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$3 + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[z, -7600.0], t$95$2, If[LessEqual[z, 1.3e-290], t$95$5, If[LessEqual[z, 1.06e-101], N[(x + N[(t$95$3 / t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e+14], t$95$5, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b - y\right)\\
t_2 := \frac{t - a}{b - y} + \frac{y \cdot x}{t_1}\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := y + t_1\\
t_5 := \frac{t_3 + y \cdot x}{t_4}\\
\mathbf{if}\;z \leq -7600:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-290}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-101}:\\
\;\;\;\;x + \frac{t_3}{t_4}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+14}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -7600 or 5.5e14 < z Initial program 40.7%
Taylor expanded in z around -inf 69.0%
+-commutative69.0%
associate--l+68.9%
Simplified84.6%
Taylor expanded in x around inf 85.3%
if -7600 < z < 1.3e-290 or 1.0600000000000001e-101 < z < 5.5e14Initial program 92.3%
if 1.3e-290 < z < 1.0600000000000001e-101Initial program 79.1%
Taylor expanded in x around inf 79.1%
Taylor expanded in z around 0 93.1%
Final simplification89.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- t a)))
(t_2 (/ (+ t_1 (* y x)) (+ y (* z b))))
(t_3 (/ (- t a) (- b y))))
(if (<= z -4.2)
t_3
(if (<= z 2.1e-290)
t_2
(if (<= z 2.45e-101)
(+ x (/ t_1 (+ y (* z (- b y)))))
(if (<= z 6000000.0) t_2 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (t - a);
double t_2 = (t_1 + (y * x)) / (y + (z * b));
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -4.2) {
tmp = t_3;
} else if (z <= 2.1e-290) {
tmp = t_2;
} else if (z <= 2.45e-101) {
tmp = x + (t_1 / (y + (z * (b - y))));
} else if (z <= 6000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = z * (t - a)
t_2 = (t_1 + (y * x)) / (y + (z * b))
t_3 = (t - a) / (b - y)
if (z <= (-4.2d0)) then
tmp = t_3
else if (z <= 2.1d-290) then
tmp = t_2
else if (z <= 2.45d-101) then
tmp = x + (t_1 / (y + (z * (b - y))))
else if (z <= 6000000.0d0) then
tmp = t_2
else
tmp = t_3
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 = z * (t - a);
double t_2 = (t_1 + (y * x)) / (y + (z * b));
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -4.2) {
tmp = t_3;
} else if (z <= 2.1e-290) {
tmp = t_2;
} else if (z <= 2.45e-101) {
tmp = x + (t_1 / (y + (z * (b - y))));
} else if (z <= 6000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (t - a) t_2 = (t_1 + (y * x)) / (y + (z * b)) t_3 = (t - a) / (b - y) tmp = 0 if z <= -4.2: tmp = t_3 elif z <= 2.1e-290: tmp = t_2 elif z <= 2.45e-101: tmp = x + (t_1 / (y + (z * (b - y)))) elif z <= 6000000.0: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(t - a)) t_2 = Float64(Float64(t_1 + Float64(y * x)) / Float64(y + Float64(z * b))) t_3 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.2) tmp = t_3; elseif (z <= 2.1e-290) tmp = t_2; elseif (z <= 2.45e-101) tmp = Float64(x + Float64(t_1 / Float64(y + Float64(z * Float64(b - y))))); elseif (z <= 6000000.0) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (t - a); t_2 = (t_1 + (y * x)) / (y + (z * b)); t_3 = (t - a) / (b - y); tmp = 0.0; if (z <= -4.2) tmp = t_3; elseif (z <= 2.1e-290) tmp = t_2; elseif (z <= 2.45e-101) tmp = x + (t_1 / (y + (z * (b - y)))); elseif (z <= 6000000.0) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2], t$95$3, If[LessEqual[z, 2.1e-290], t$95$2, If[LessEqual[z, 2.45e-101], N[(x + N[(t$95$1 / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6000000.0], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t - a\right)\\
t_2 := \frac{t_1 + y \cdot x}{y + z \cdot b}\\
t_3 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.2:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-290}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-101}:\\
\;\;\;\;x + \frac{t_1}{y + z \cdot \left(b - y\right)}\\
\mathbf{elif}\;z \leq 6000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -4.20000000000000018 or 6e6 < z Initial program 42.1%
Taylor expanded in z around inf 79.7%
if -4.20000000000000018 < z < 2.1000000000000001e-290 or 2.45e-101 < z < 6e6Initial program 92.1%
Taylor expanded in b around inf 89.7%
if 2.1000000000000001e-290 < z < 2.45e-101Initial program 79.1%
Taylor expanded in x around inf 79.1%
Taylor expanded in z around 0 93.1%
Final simplification85.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -44.0) (not (<= z 1.2e+14))) (/ (- t a) (- b y)) (+ x (/ (* z (- t a)) (+ y (* z (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -44.0) || !(z <= 1.2e+14)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * (t - 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 <= (-44.0d0)) .or. (.not. (z <= 1.2d+14))) then
tmp = (t - a) / (b - y)
else
tmp = x + ((z * (t - 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 <= -44.0) || !(z <= 1.2e+14)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * (t - a)) / (y + (z * (b - y))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -44.0) or not (z <= 1.2e+14): tmp = (t - a) / (b - y) else: tmp = x + ((z * (t - a)) / (y + (z * (b - y)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -44.0) || !(z <= 1.2e+14)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * Float64(t - 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 <= -44.0) || ~((z <= 1.2e+14))) tmp = (t - a) / (b - y); else tmp = x + ((z * (t - a)) / (y + (z * (b - y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -44.0], N[Not[LessEqual[z, 1.2e+14]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -44 \lor \neg \left(z \leq 1.2 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -44 or 1.2e14 < z Initial program 40.7%
Taylor expanded in z around inf 80.5%
if -44 < z < 1.2e14Initial program 88.0%
Taylor expanded in x around inf 88.0%
Taylor expanded in z around 0 78.6%
Final simplification79.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))) (t_2 (/ (- a) b)) (t_3 (/ x (- 1.0 z))))
(if (<= y -2.9e+77)
t_3
(if (<= y -2.9e-212)
t_1
(if (<= y 1.4e-281)
t_2
(if (<= y 1.55e-230) t_1 (if (<= y 1.05e-51) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double t_2 = -a / b;
double t_3 = x / (1.0 - z);
double tmp;
if (y <= -2.9e+77) {
tmp = t_3;
} else if (y <= -2.9e-212) {
tmp = t_1;
} else if (y <= 1.4e-281) {
tmp = t_2;
} else if (y <= 1.55e-230) {
tmp = t_1;
} else if (y <= 1.05e-51) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t / (b - y)
t_2 = -a / b
t_3 = x / (1.0d0 - z)
if (y <= (-2.9d+77)) then
tmp = t_3
else if (y <= (-2.9d-212)) then
tmp = t_1
else if (y <= 1.4d-281) then
tmp = t_2
else if (y <= 1.55d-230) then
tmp = t_1
else if (y <= 1.05d-51) then
tmp = t_2
else
tmp = t_3
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 t_2 = -a / b;
double t_3 = x / (1.0 - z);
double tmp;
if (y <= -2.9e+77) {
tmp = t_3;
} else if (y <= -2.9e-212) {
tmp = t_1;
} else if (y <= 1.4e-281) {
tmp = t_2;
} else if (y <= 1.55e-230) {
tmp = t_1;
} else if (y <= 1.05e-51) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) t_2 = -a / b t_3 = x / (1.0 - z) tmp = 0 if y <= -2.9e+77: tmp = t_3 elif y <= -2.9e-212: tmp = t_1 elif y <= 1.4e-281: tmp = t_2 elif y <= 1.55e-230: tmp = t_1 elif y <= 1.05e-51: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) t_2 = Float64(Float64(-a) / b) t_3 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -2.9e+77) tmp = t_3; elseif (y <= -2.9e-212) tmp = t_1; elseif (y <= 1.4e-281) tmp = t_2; elseif (y <= 1.55e-230) tmp = t_1; elseif (y <= 1.05e-51) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); t_2 = -a / b; t_3 = x / (1.0 - z); tmp = 0.0; if (y <= -2.9e+77) tmp = t_3; elseif (y <= -2.9e-212) tmp = t_1; elseif (y <= 1.4e-281) tmp = t_2; elseif (y <= 1.55e-230) tmp = t_1; elseif (y <= 1.05e-51) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-a) / b), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e+77], t$95$3, If[LessEqual[y, -2.9e-212], t$95$1, If[LessEqual[y, 1.4e-281], t$95$2, If[LessEqual[y, 1.55e-230], t$95$1, If[LessEqual[y, 1.05e-51], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
t_2 := \frac{-a}{b}\\
t_3 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+77}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-212}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-281}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-230}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-51}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -2.9000000000000002e77 or 1.05000000000000001e-51 < y Initial program 52.1%
Taylor expanded in y around inf 47.6%
+-commutative47.6%
mul-1-neg47.6%
unsub-neg47.6%
Simplified47.6%
if -2.9000000000000002e77 < y < -2.8999999999999999e-212 or 1.40000000000000003e-281 < y < 1.55e-230Initial program 82.0%
Taylor expanded in z around -inf 60.8%
+-commutative60.8%
associate--l+60.8%
Simplified63.5%
Taylor expanded in x around inf 70.8%
Taylor expanded in t around inf 46.4%
if -2.8999999999999999e-212 < y < 1.40000000000000003e-281 or 1.55e-230 < y < 1.05000000000000001e-51Initial program 69.4%
Taylor expanded in b around inf 53.9%
Taylor expanded in a around inf 56.0%
mul-1-neg56.0%
Simplified56.0%
Final simplification49.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -7.8e+77)
t_1
(if (<= y -2.1e-40)
(/ t (- b y))
(if (<= y -1.2e-47)
(+ x (* z x))
(if (<= y 5.7e-49) (/ (- t a) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -7.8e+77) {
tmp = t_1;
} else if (y <= -2.1e-40) {
tmp = t / (b - y);
} else if (y <= -1.2e-47) {
tmp = x + (z * x);
} else if (y <= 5.7e-49) {
tmp = (t - a) / b;
} 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 = x / (1.0d0 - z)
if (y <= (-7.8d+77)) then
tmp = t_1
else if (y <= (-2.1d-40)) then
tmp = t / (b - y)
else if (y <= (-1.2d-47)) then
tmp = x + (z * x)
else if (y <= 5.7d-49) then
tmp = (t - a) / b
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 = x / (1.0 - z);
double tmp;
if (y <= -7.8e+77) {
tmp = t_1;
} else if (y <= -2.1e-40) {
tmp = t / (b - y);
} else if (y <= -1.2e-47) {
tmp = x + (z * x);
} else if (y <= 5.7e-49) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -7.8e+77: tmp = t_1 elif y <= -2.1e-40: tmp = t / (b - y) elif y <= -1.2e-47: tmp = x + (z * x) elif y <= 5.7e-49: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -7.8e+77) tmp = t_1; elseif (y <= -2.1e-40) tmp = Float64(t / Float64(b - y)); elseif (y <= -1.2e-47) tmp = Float64(x + Float64(z * x)); elseif (y <= 5.7e-49) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -7.8e+77) tmp = t_1; elseif (y <= -2.1e-40) tmp = t / (b - y); elseif (y <= -1.2e-47) tmp = x + (z * x); elseif (y <= 5.7e-49) tmp = (t - a) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.8e+77], t$95$1, If[LessEqual[y, -2.1e-40], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.2e-47], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.7e-49], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{+77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-40}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-47}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{-49}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -7.7999999999999995e77 or 5.7000000000000003e-49 < y Initial program 52.1%
Taylor expanded in y around inf 47.6%
+-commutative47.6%
mul-1-neg47.6%
unsub-neg47.6%
Simplified47.6%
if -7.7999999999999995e77 < y < -2.10000000000000018e-40Initial program 75.2%
Taylor expanded in z around -inf 54.5%
+-commutative54.5%
associate--l+54.5%
Simplified62.7%
Taylor expanded in x around inf 63.1%
Taylor expanded in t around inf 35.8%
if -2.10000000000000018e-40 < y < -1.2e-47Initial program 100.0%
Taylor expanded in y around inf 75.2%
+-commutative75.2%
mul-1-neg75.2%
unsub-neg75.2%
Simplified75.2%
Taylor expanded in z around 0 76.8%
if -1.2e-47 < y < 5.7000000000000003e-49Initial program 75.4%
Taylor expanded in y around 0 71.9%
Final simplification57.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.8e-25) (not (<= z 4.8e-73))) (/ (- t a) (- b y)) (+ x (/ (* z (- t a)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.8e-25) || !(z <= 4.8e-73)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * (t - a)) / 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 <= (-5.8d-25)) .or. (.not. (z <= 4.8d-73))) then
tmp = (t - a) / (b - y)
else
tmp = x + ((z * (t - a)) / 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 <= -5.8e-25) || !(z <= 4.8e-73)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * (t - a)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.8e-25) or not (z <= 4.8e-73): tmp = (t - a) / (b - y) else: tmp = x + ((z * (t - a)) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.8e-25) || !(z <= 4.8e-73)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * Float64(t - a)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5.8e-25) || ~((z <= 4.8e-73))) tmp = (t - a) / (b - y); else tmp = x + ((z * (t - a)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.8e-25], N[Not[LessEqual[z, 4.8e-73]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-25} \lor \neg \left(z \leq 4.8 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot \left(t - a\right)}{y}\\
\end{array}
\end{array}
if z < -5.8000000000000001e-25 or 4.80000000000000011e-73 < z Initial program 49.8%
Taylor expanded in z around inf 75.4%
if -5.8000000000000001e-25 < z < 4.80000000000000011e-73Initial program 86.1%
Taylor expanded in x around inf 86.2%
Taylor expanded in z around 0 81.4%
Taylor expanded in z around 0 70.1%
Final simplification73.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.8e-26) (not (<= z 8.4e-92))) (/ (- t a) (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.8e-26) || !(z <= 8.4e-92)) {
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 <= (-1.8d-26)) .or. (.not. (z <= 8.4d-92))) 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 <= -1.8e-26) || !(z <= 8.4e-92)) {
tmp = (t - a) / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.8e-26) or not (z <= 8.4e-92): tmp = (t - a) / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.8e-26) || !(z <= 8.4e-92)) 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 <= -1.8e-26) || ~((z <= 8.4e-92))) tmp = (t - a) / (b - y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.8e-26], N[Not[LessEqual[z, 8.4e-92]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-26} \lor \neg \left(z \leq 8.4 \cdot 10^{-92}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.8000000000000001e-26 or 8.4e-92 < z Initial program 50.8%
Taylor expanded in z around inf 74.7%
if -1.8000000000000001e-26 < z < 8.4e-92Initial program 85.7%
Taylor expanded in z around 0 50.2%
Final simplification65.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.3e-23) (not (<= z 7e-89))) (/ t (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.3e-23) || !(z <= 7e-89)) {
tmp = t / (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 <= (-1.3d-23)) .or. (.not. (z <= 7d-89))) then
tmp = t / (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 <= -1.3e-23) || !(z <= 7e-89)) {
tmp = t / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.3e-23) or not (z <= 7e-89): tmp = t / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.3e-23) || !(z <= 7e-89)) tmp = Float64(t / 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 <= -1.3e-23) || ~((z <= 7e-89))) tmp = t / (b - y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.3e-23], N[Not[LessEqual[z, 7e-89]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-23} \lor \neg \left(z \leq 7 \cdot 10^{-89}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.3e-23 or 6.9999999999999994e-89 < z Initial program 50.8%
Taylor expanded in z around -inf 67.1%
+-commutative67.1%
associate--l+67.1%
Simplified80.1%
Taylor expanded in x around inf 80.7%
Taylor expanded in t around inf 39.0%
if -1.3e-23 < z < 6.9999999999999994e-89Initial program 85.7%
Taylor expanded in z around 0 50.2%
Final simplification43.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.75e-25) (/ t b) (if (<= z 2.25e-74) x (/ (- a) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.75e-25) {
tmp = t / b;
} else if (z <= 2.25e-74) {
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.75d-25)) then
tmp = t / b
else if (z <= 2.25d-74) 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.75e-25) {
tmp = t / b;
} else if (z <= 2.25e-74) {
tmp = x;
} else {
tmp = -a / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.75e-25: tmp = t / b elif z <= 2.25e-74: tmp = x else: tmp = -a / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.75e-25) tmp = Float64(t / b); elseif (z <= 2.25e-74) tmp = x; else tmp = Float64(Float64(-a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.75e-25) tmp = t / b; elseif (z <= 2.25e-74) tmp = x; else tmp = -a / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.75e-25], N[(t / b), $MachinePrecision], If[LessEqual[z, 2.25e-74], x, N[((-a) / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.75 \cdot 10^{-25}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-74}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{-a}{b}\\
\end{array}
\end{array}
if z < -3.74999999999999994e-25Initial program 47.0%
Taylor expanded in b around inf 28.5%
Taylor expanded in t around inf 35.2%
if -3.74999999999999994e-25 < z < 2.25e-74Initial program 85.9%
Taylor expanded in z around 0 49.8%
if 2.25e-74 < z Initial program 53.4%
Taylor expanded in b around inf 34.7%
Taylor expanded in a around inf 27.9%
mul-1-neg27.9%
Simplified27.9%
Final simplification38.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.2e-25) (/ t b) (if (<= z 6.8e-89) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.2e-25) {
tmp = t / b;
} else if (z <= 6.8e-89) {
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 <= (-2.2d-25)) then
tmp = t / b
else if (z <= 6.8d-89) 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 <= -2.2e-25) {
tmp = t / b;
} else if (z <= 6.8e-89) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.2e-25: tmp = t / b elif z <= 6.8e-89: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.2e-25) tmp = Float64(t / b); elseif (z <= 6.8e-89) 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 <= -2.2e-25) tmp = t / b; elseif (z <= 6.8e-89) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.2e-25], N[(t / b), $MachinePrecision], If[LessEqual[z, 6.8e-89], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-25}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-89}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -2.2000000000000002e-25 or 6.8000000000000001e-89 < z Initial program 50.8%
Taylor expanded in b around inf 32.3%
Taylor expanded in t around inf 30.4%
if -2.2000000000000002e-25 < z < 6.8000000000000001e-89Initial program 85.7%
Taylor expanded in z around 0 50.2%
Final simplification38.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 64.6%
Taylor expanded in z around 0 22.9%
Final simplification22.9%
(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 2023279
(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)))))