
(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 15 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
(if (or (<= z -3.5e+76) (not (<= z 1.7e+26)))
(+
(+ (* (/ y z) (/ x (- b y))) (/ (- t a) (- b y)))
(* y (/ (- a t) (* z (pow (- b y) 2.0)))))
(/ (fma x y (* z (- t a))) (fma z (- b y) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.5e+76) || !(z <= 1.7e+26)) {
tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * pow((b - y), 2.0))));
} else {
tmp = fma(x, y, (z * (t - a))) / fma(z, (b - y), y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.5e+76) || !(z <= 1.7e+26)) tmp = Float64(Float64(Float64(Float64(y / z) * Float64(x / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))) + Float64(y * Float64(Float64(a - t) / Float64(z * (Float64(b - y) ^ 2.0))))); else tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / fma(z, Float64(b - y), y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.5e+76], N[Not[LessEqual[z, 1.7e+26]], $MachinePrecision]], N[(N[(N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / N[(z * N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+76} \lor \neg \left(z \leq 1.7 \cdot 10^{+26}\right):\\
\;\;\;\;\left(\frac{y}{z} \cdot \frac{x}{b - y} + \frac{t - a}{b - y}\right) + y \cdot \frac{a - t}{z \cdot {\left(b - y\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\end{array}
\end{array}
if z < -3.5e76 or 1.7000000000000001e26 < z Initial program 38.1%
fma-define38.2%
+-commutative38.2%
fma-define38.2%
Simplified38.2%
Taylor expanded in z around inf 75.2%
associate--r+75.2%
+-commutative75.2%
associate--l+75.2%
*-commutative75.2%
times-frac78.4%
div-sub78.4%
associate-/l*94.4%
Simplified94.4%
if -3.5e76 < z < 1.7000000000000001e26Initial program 91.2%
fma-define91.2%
+-commutative91.2%
fma-define91.2%
Simplified91.2%
Final simplification92.6%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -3.5e+76) (not (<= z 4.3e+21)))
(+
(+ (* (/ y z) (/ x (- b y))) (/ (- t a) (- b y)))
(* y (/ (- a t) (* z (pow (- b y) 2.0)))))
(/ (+ (* z (- t a)) (* y x)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.5e+76) || !(z <= 4.3e+21)) {
tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * pow((b - y), 2.0))));
} else {
tmp = ((z * (t - a)) + (y * x)) / (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 <= (-3.5d+76)) .or. (.not. (z <= 4.3d+21))) then
tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * ((b - y) ** 2.0d0))))
else
tmp = ((z * (t - a)) + (y * x)) / (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 <= -3.5e+76) || !(z <= 4.3e+21)) {
tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * Math.pow((b - y), 2.0))));
} else {
tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.5e+76) or not (z <= 4.3e+21): tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * math.pow((b - y), 2.0)))) else: tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.5e+76) || !(z <= 4.3e+21)) tmp = Float64(Float64(Float64(Float64(y / z) * Float64(x / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))) + Float64(y * Float64(Float64(a - t) / Float64(z * (Float64(b - y) ^ 2.0))))); else tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(y * x)) / 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 <= -3.5e+76) || ~((z <= 4.3e+21))) tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * ((b - y) ^ 2.0)))); else tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.5e+76], N[Not[LessEqual[z, 4.3e+21]], $MachinePrecision]], N[(N[(N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / N[(z * N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+76} \lor \neg \left(z \leq 4.3 \cdot 10^{+21}\right):\\
\;\;\;\;\left(\frac{y}{z} \cdot \frac{x}{b - y} + \frac{t - a}{b - y}\right) + y \cdot \frac{a - t}{z \cdot {\left(b - y\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + y \cdot x}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -3.5e76 or 4.3e21 < z Initial program 38.1%
fma-define38.2%
+-commutative38.2%
fma-define38.2%
Simplified38.2%
Taylor expanded in z around inf 75.2%
associate--r+75.2%
+-commutative75.2%
associate--l+75.2%
*-commutative75.2%
times-frac78.4%
div-sub78.4%
associate-/l*94.4%
Simplified94.4%
if -3.5e76 < z < 4.3e21Initial program 91.2%
Final simplification92.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* z (- t a)) (+ y (* z (- b y))))) (t_2 (/ (- t a) (- b y))))
(if (<= z -4e+30)
t_2
(if (<= z -1.45e-149)
t_1
(if (<= z 1.85e-90)
(/ (+ x (* t (/ z y))) (- (- z) -1.0))
(if (<= z 1.15e-5) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * (t - a)) / (y + (z * (b - y)));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -4e+30) {
tmp = t_2;
} else if (z <= -1.45e-149) {
tmp = t_1;
} else if (z <= 1.85e-90) {
tmp = (x + (t * (z / y))) / (-z - -1.0);
} else if (z <= 1.15e-5) {
tmp = t_1;
} 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) :: tmp
t_1 = (z * (t - a)) / (y + (z * (b - y)))
t_2 = (t - a) / (b - y)
if (z <= (-4d+30)) then
tmp = t_2
else if (z <= (-1.45d-149)) then
tmp = t_1
else if (z <= 1.85d-90) then
tmp = (x + (t * (z / y))) / (-z - (-1.0d0))
else if (z <= 1.15d-5) then
tmp = t_1
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 * (t - a)) / (y + (z * (b - y)));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -4e+30) {
tmp = t_2;
} else if (z <= -1.45e-149) {
tmp = t_1;
} else if (z <= 1.85e-90) {
tmp = (x + (t * (z / y))) / (-z - -1.0);
} else if (z <= 1.15e-5) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * (t - a)) / (y + (z * (b - y))) t_2 = (t - a) / (b - y) tmp = 0 if z <= -4e+30: tmp = t_2 elif z <= -1.45e-149: tmp = t_1 elif z <= 1.85e-90: tmp = (x + (t * (z / y))) / (-z - -1.0) elif z <= 1.15e-5: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * Float64(b - y)))) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4e+30) tmp = t_2; elseif (z <= -1.45e-149) tmp = t_1; elseif (z <= 1.85e-90) tmp = Float64(Float64(x + Float64(t * Float64(z / y))) / Float64(Float64(-z) - -1.0)); elseif (z <= 1.15e-5) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * (t - a)) / (y + (z * (b - y))); t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -4e+30) tmp = t_2; elseif (z <= -1.45e-149) tmp = t_1; elseif (z <= 1.85e-90) tmp = (x + (t * (z / y))) / (-z - -1.0); elseif (z <= 1.15e-5) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+30], t$95$2, If[LessEqual[z, -1.45e-149], t$95$1, If[LessEqual[z, 1.85e-90], N[(N[(x + N[(t * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[((-z) - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-5], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-90}:\\
\;\;\;\;\frac{x + t \cdot \frac{z}{y}}{\left(-z\right) - -1}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.0000000000000001e30 or 1.15e-5 < z Initial program 44.6%
fma-define44.6%
+-commutative44.6%
fma-define44.6%
Simplified44.6%
Taylor expanded in z around inf 85.3%
if -4.0000000000000001e30 < z < -1.45e-149 or 1.85000000000000009e-90 < z < 1.15e-5Initial program 93.0%
fma-define93.0%
+-commutative93.0%
fma-define93.0%
Simplified93.0%
Taylor expanded in x around 0 71.9%
if -1.45e-149 < z < 1.85000000000000009e-90Initial program 89.4%
fma-define89.4%
Simplified89.4%
Taylor expanded in y around inf 89.5%
associate-/l*77.3%
Simplified77.3%
Taylor expanded in y around -inf 57.8%
associate-*r*57.8%
neg-mul-157.8%
sub-neg57.8%
metadata-eval57.8%
Simplified57.8%
Taylor expanded in a around 0 69.7%
mul-1-neg69.7%
associate-/l*69.9%
sub-neg69.9%
metadata-eval69.9%
+-commutative69.9%
Simplified69.9%
Final simplification78.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4e+30)
t_1
(if (<= z -1.5e-149)
(/ (* z (- t a)) (+ y (* z (- b y))))
(if (<= z 9000.0)
(/ (* y (+ x (* z (/ (- t a) y)))) (+ y (* z b)))
t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4e+30) {
tmp = t_1;
} else if (z <= -1.5e-149) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else if (z <= 9000.0) {
tmp = (y * (x + (z * ((t - a) / y)))) / (y + (z * 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 = (t - a) / (b - y)
if (z <= (-4d+30)) then
tmp = t_1
else if (z <= (-1.5d-149)) then
tmp = (z * (t - a)) / (y + (z * (b - y)))
else if (z <= 9000.0d0) then
tmp = (y * (x + (z * ((t - a) / y)))) / (y + (z * 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 = (t - a) / (b - y);
double tmp;
if (z <= -4e+30) {
tmp = t_1;
} else if (z <= -1.5e-149) {
tmp = (z * (t - a)) / (y + (z * (b - y)));
} else if (z <= 9000.0) {
tmp = (y * (x + (z * ((t - a) / y)))) / (y + (z * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -4e+30: tmp = t_1 elif z <= -1.5e-149: tmp = (z * (t - a)) / (y + (z * (b - y))) elif z <= 9000.0: tmp = (y * (x + (z * ((t - a) / y)))) / (y + (z * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4e+30) tmp = t_1; elseif (z <= -1.5e-149) tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * Float64(b - y)))); elseif (z <= 9000.0) tmp = Float64(Float64(y * Float64(x + Float64(z * Float64(Float64(t - a) / y)))) / Float64(y + Float64(z * b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -4e+30) tmp = t_1; elseif (z <= -1.5e-149) tmp = (z * (t - a)) / (y + (z * (b - y))); elseif (z <= 9000.0) tmp = (y * (x + (z * ((t - a) / y)))) / (y + (z * b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+30], t$95$1, If[LessEqual[z, -1.5e-149], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9000.0], N[(N[(y * N[(x + N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-149}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{elif}\;z \leq 9000:\\
\;\;\;\;\frac{y \cdot \left(x + z \cdot \frac{t - a}{y}\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.0000000000000001e30 or 9e3 < z Initial program 44.4%
fma-define44.5%
+-commutative44.5%
fma-define44.5%
Simplified44.5%
Taylor expanded in z around inf 86.6%
if -4.0000000000000001e30 < z < -1.5000000000000001e-149Initial program 91.5%
fma-define91.5%
+-commutative91.5%
fma-define91.6%
Simplified91.6%
Taylor expanded in x around 0 74.8%
if -1.5000000000000001e-149 < z < 9e3Initial program 90.0%
fma-define90.0%
Simplified90.0%
Taylor expanded in y around inf 89.0%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in b around inf 77.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))) (t_2 (/ (- t a) (- b y))))
(if (<= z -1e+31)
t_2
(if (<= z -3.8e-146)
(/ (* z (- t a)) t_1)
(if (<= z 126000000.0) (/ (+ (* y x) (* z t)) 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 = (t - a) / (b - y);
double tmp;
if (z <= -1e+31) {
tmp = t_2;
} else if (z <= -3.8e-146) {
tmp = (z * (t - a)) / t_1;
} else if (z <= 126000000.0) {
tmp = ((y * x) + (z * t)) / t_1;
} 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) :: tmp
t_1 = y + (z * (b - y))
t_2 = (t - a) / (b - y)
if (z <= (-1d+31)) then
tmp = t_2
else if (z <= (-3.8d-146)) then
tmp = (z * (t - a)) / t_1
else if (z <= 126000000.0d0) then
tmp = ((y * x) + (z * t)) / t_1
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 = y + (z * (b - y));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1e+31) {
tmp = t_2;
} else if (z <= -3.8e-146) {
tmp = (z * (t - a)) / t_1;
} else if (z <= 126000000.0) {
tmp = ((y * x) + (z * t)) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = (t - a) / (b - y) tmp = 0 if z <= -1e+31: tmp = t_2 elif z <= -3.8e-146: tmp = (z * (t - a)) / t_1 elif z <= 126000000.0: tmp = ((y * x) + (z * t)) / 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(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1e+31) tmp = t_2; elseif (z <= -3.8e-146) tmp = Float64(Float64(z * Float64(t - a)) / t_1); elseif (z <= 126000000.0) tmp = Float64(Float64(Float64(y * x) + Float64(z * t)) / t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -1e+31) tmp = t_2; elseif (z <= -3.8e-146) tmp = (z * (t - a)) / t_1; elseif (z <= 126000000.0) tmp = ((y * x) + (z * t)) / t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+31], t$95$2, If[LessEqual[z, -3.8e-146], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 126000000.0], N[(N[(N[(y * x), $MachinePrecision] + N[(z * t), $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{t - a}{b - y}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-146}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{t\_1}\\
\mathbf{elif}\;z \leq 126000000:\\
\;\;\;\;\frac{y \cdot x + z \cdot t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -9.9999999999999996e30 or 1.26e8 < z Initial program 44.4%
fma-define44.5%
+-commutative44.5%
fma-define44.5%
Simplified44.5%
Taylor expanded in z around inf 86.6%
if -9.9999999999999996e30 < z < -3.79999999999999994e-146Initial program 91.3%
fma-define91.3%
+-commutative91.3%
fma-define91.3%
Simplified91.3%
Taylor expanded in x around 0 74.2%
if -3.79999999999999994e-146 < z < 1.26e8Initial program 90.1%
Taylor expanded in t around inf 73.5%
*-commutative73.5%
Simplified73.5%
Final simplification80.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.2e+77) (not (<= z 1.45e+64))) (/ (- t a) (- b y)) (/ (+ (* z (- t a)) (* y x)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.2e+77) || !(z <= 1.45e+64)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((z * (t - a)) + (y * x)) / (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 <= (-3.2d+77)) .or. (.not. (z <= 1.45d+64))) then
tmp = (t - a) / (b - y)
else
tmp = ((z * (t - a)) + (y * x)) / (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 <= -3.2e+77) || !(z <= 1.45e+64)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.2e+77) or not (z <= 1.45e+64): tmp = (t - a) / (b - y) else: tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.2e+77) || !(z <= 1.45e+64)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(y * x)) / 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 <= -3.2e+77) || ~((z <= 1.45e+64))) tmp = (t - a) / (b - y); else tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.2e+77], N[Not[LessEqual[z, 1.45e+64]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+77} \lor \neg \left(z \leq 1.45 \cdot 10^{+64}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + y \cdot x}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -3.2000000000000002e77 or 1.44999999999999997e64 < z Initial program 35.5%
fma-define35.6%
+-commutative35.6%
fma-define35.6%
Simplified35.6%
Taylor expanded in z around inf 90.9%
if -3.2000000000000002e77 < z < 1.44999999999999997e64Initial program 88.8%
Final simplification89.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -0.64)
t_1
(if (<= z -1.5e-149)
(/ (* z (- t a)) (+ y (* z b)))
(if (<= z 1.3e-5) (+ x (* z (+ x (/ (- t a) y)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -0.64) {
tmp = t_1;
} else if (z <= -1.5e-149) {
tmp = (z * (t - a)) / (y + (z * b));
} else if (z <= 1.3e-5) {
tmp = x + (z * (x + ((t - a) / y)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-0.64d0)) then
tmp = t_1
else if (z <= (-1.5d-149)) then
tmp = (z * (t - a)) / (y + (z * b))
else if (z <= 1.3d-5) then
tmp = x + (z * (x + ((t - a) / y)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -0.64) {
tmp = t_1;
} else if (z <= -1.5e-149) {
tmp = (z * (t - a)) / (y + (z * b));
} else if (z <= 1.3e-5) {
tmp = x + (z * (x + ((t - a) / y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -0.64: tmp = t_1 elif z <= -1.5e-149: tmp = (z * (t - a)) / (y + (z * b)) elif z <= 1.3e-5: tmp = x + (z * (x + ((t - a) / y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -0.64) tmp = t_1; elseif (z <= -1.5e-149) tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * b))); elseif (z <= 1.3e-5) tmp = Float64(x + Float64(z * Float64(x + Float64(Float64(t - a) / y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -0.64) tmp = t_1; elseif (z <= -1.5e-149) tmp = (z * (t - a)) / (y + (z * b)); elseif (z <= 1.3e-5) tmp = x + (z * (x + ((t - a) / y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.64], t$95$1, If[LessEqual[z, -1.5e-149], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-5], N[(x + N[(z * N[(x + N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -0.64:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-149}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-5}:\\
\;\;\;\;x + z \cdot \left(x + \frac{t - a}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.640000000000000013 or 1.29999999999999992e-5 < z Initial program 46.1%
fma-define46.2%
+-commutative46.2%
fma-define46.2%
Simplified46.2%
Taylor expanded in z around inf 85.1%
if -0.640000000000000013 < z < -1.5000000000000001e-149Initial program 90.8%
fma-define90.8%
+-commutative90.8%
fma-define90.8%
Simplified90.8%
Taylor expanded in x around 0 75.3%
Taylor expanded in b around inf 72.2%
if -1.5000000000000001e-149 < z < 1.29999999999999992e-5Initial program 89.9%
fma-define89.9%
Simplified89.9%
Taylor expanded in y around inf 88.9%
associate-/l*77.8%
Simplified77.8%
Taylor expanded in y around -inf 54.8%
associate-*r*54.8%
neg-mul-154.8%
sub-neg54.8%
metadata-eval54.8%
Simplified54.8%
Taylor expanded in z around 0 63.7%
mul-1-neg63.7%
distribute-rgt-neg-in63.7%
div-sub63.9%
sub-neg63.9%
distribute-neg-in63.9%
mul-1-neg63.9%
remove-double-neg63.9%
remove-double-neg63.9%
Simplified63.9%
Final simplification75.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.9e-44) (not (<= z 2.3e-5))) (/ (- t a) (- b y)) (+ x (* z (+ x (/ (- t a) y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.9e-44) || !(z <= 2.3e-5)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + (z * (x + ((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 <= (-2.9d-44)) .or. (.not. (z <= 2.3d-5))) then
tmp = (t - a) / (b - y)
else
tmp = x + (z * (x + ((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 <= -2.9e-44) || !(z <= 2.3e-5)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + (z * (x + ((t - a) / y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.9e-44) or not (z <= 2.3e-5): tmp = (t - a) / (b - y) else: tmp = x + (z * (x + ((t - a) / y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.9e-44) || !(z <= 2.3e-5)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(z * Float64(x + Float64(Float64(t - a) / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.9e-44) || ~((z <= 2.3e-5))) tmp = (t - a) / (b - y); else tmp = x + (z * (x + ((t - a) / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.9e-44], N[Not[LessEqual[z, 2.3e-5]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x + N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-44} \lor \neg \left(z \leq 2.3 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x + \frac{t - a}{y}\right)\\
\end{array}
\end{array}
if z < -2.9000000000000001e-44 or 2.3e-5 < z Initial program 49.9%
fma-define50.0%
+-commutative50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in z around inf 84.2%
if -2.9000000000000001e-44 < z < 2.3e-5Initial program 89.4%
fma-define89.4%
Simplified89.4%
Taylor expanded in y around inf 87.7%
associate-/l*73.0%
Simplified73.0%
Taylor expanded in y around -inf 51.8%
associate-*r*51.8%
neg-mul-151.8%
sub-neg51.8%
metadata-eval51.8%
Simplified51.8%
Taylor expanded in z around 0 61.4%
mul-1-neg61.4%
distribute-rgt-neg-in61.4%
div-sub61.5%
sub-neg61.5%
distribute-neg-in61.5%
mul-1-neg61.5%
remove-double-neg61.5%
remove-double-neg61.5%
Simplified61.5%
Final simplification73.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -3.45e+55)
t_1
(if (<= y -3.4e-85) (/ t (- b y)) (if (<= y 7e+62) (/ (- 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 <= -3.45e+55) {
tmp = t_1;
} else if (y <= -3.4e-85) {
tmp = t / (b - y);
} else if (y <= 7e+62) {
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 <= (-3.45d+55)) then
tmp = t_1
else if (y <= (-3.4d-85)) then
tmp = t / (b - y)
else if (y <= 7d+62) 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 <= -3.45e+55) {
tmp = t_1;
} else if (y <= -3.4e-85) {
tmp = t / (b - y);
} else if (y <= 7e+62) {
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 <= -3.45e+55: tmp = t_1 elif y <= -3.4e-85: tmp = t / (b - y) elif y <= 7e+62: 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 <= -3.45e+55) tmp = t_1; elseif (y <= -3.4e-85) tmp = Float64(t / Float64(b - y)); elseif (y <= 7e+62) 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 <= -3.45e+55) tmp = t_1; elseif (y <= -3.4e-85) tmp = t / (b - y); elseif (y <= 7e+62) 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, -3.45e+55], t$95$1, If[LessEqual[y, -3.4e-85], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+62], 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 -3.45 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-85}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+62}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.4500000000000002e55 or 6.99999999999999967e62 < y Initial program 54.8%
fma-define54.8%
+-commutative54.8%
fma-define54.8%
Simplified54.8%
Taylor expanded in y around inf 61.0%
mul-1-neg61.0%
unsub-neg61.0%
Simplified61.0%
if -3.4500000000000002e55 < y < -3.4e-85Initial program 69.5%
fma-define69.5%
+-commutative69.5%
fma-define69.5%
Simplified69.5%
Taylor expanded in z around inf 69.9%
Taylor expanded in t around inf 47.3%
if -3.4e-85 < y < 6.99999999999999967e62Initial program 76.6%
fma-define76.6%
+-commutative76.6%
fma-define76.6%
Simplified76.6%
Taylor expanded in y around 0 62.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.5e-149) (not (<= z 2.4e-87))) (/ (- t a) (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.5e-149) || !(z <= 2.4e-87)) {
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.5d-149)) .or. (.not. (z <= 2.4d-87))) 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.5e-149) || !(z <= 2.4e-87)) {
tmp = (t - a) / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.5e-149) or not (z <= 2.4e-87): tmp = (t - a) / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.5e-149) || !(z <= 2.4e-87)) 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.5e-149) || ~((z <= 2.4e-87))) 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.5e-149], N[Not[LessEqual[z, 2.4e-87]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-149} \lor \neg \left(z \leq 2.4 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.5000000000000001e-149 or 2.4e-87 < z Initial program 59.5%
fma-define59.5%
+-commutative59.5%
fma-define59.5%
Simplified59.5%
Taylor expanded in z around inf 73.4%
if -1.5000000000000001e-149 < z < 2.4e-87Initial program 89.4%
fma-define89.4%
+-commutative89.4%
fma-define89.4%
Simplified89.4%
Taylor expanded in z around 0 58.4%
Final simplification69.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.05e+55) (not (<= y 3.7e-35))) (/ x (- 1.0 z)) (/ t (- b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.05e+55) || !(y <= 3.7e-35)) {
tmp = x / (1.0 - z);
} else {
tmp = t / (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 ((y <= (-2.05d+55)) .or. (.not. (y <= 3.7d-35))) then
tmp = x / (1.0d0 - z)
else
tmp = t / (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 ((y <= -2.05e+55) || !(y <= 3.7e-35)) {
tmp = x / (1.0 - z);
} else {
tmp = t / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.05e+55) or not (y <= 3.7e-35): tmp = x / (1.0 - z) else: tmp = t / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.05e+55) || !(y <= 3.7e-35)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(t / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.05e+55) || ~((y <= 3.7e-35))) tmp = x / (1.0 - z); else tmp = t / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.05e+55], N[Not[LessEqual[y, 3.7e-35]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+55} \lor \neg \left(y \leq 3.7 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y}\\
\end{array}
\end{array}
if y < -2.04999999999999991e55 or 3.6999999999999999e-35 < y Initial program 56.1%
fma-define56.2%
+-commutative56.2%
fma-define56.2%
Simplified56.2%
Taylor expanded in y around inf 53.9%
mul-1-neg53.9%
unsub-neg53.9%
Simplified53.9%
if -2.04999999999999991e55 < y < 3.6999999999999999e-35Initial program 77.1%
fma-define77.1%
+-commutative77.1%
fma-define77.1%
Simplified77.1%
Taylor expanded in z around inf 70.2%
Taylor expanded in t around inf 41.3%
Final simplification46.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.5e-44) (not (<= z 3.7e-44))) (/ t (- b y)) (+ x (* z x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.5e-44) || !(z <= 3.7e-44)) {
tmp = t / (b - y);
} else {
tmp = x + (z * 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 <= (-7.5d-44)) .or. (.not. (z <= 3.7d-44))) then
tmp = t / (b - y)
else
tmp = x + (z * 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 <= -7.5e-44) || !(z <= 3.7e-44)) {
tmp = t / (b - y);
} else {
tmp = x + (z * x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7.5e-44) or not (z <= 3.7e-44): tmp = t / (b - y) else: tmp = x + (z * x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7.5e-44) || !(z <= 3.7e-44)) tmp = Float64(t / Float64(b - y)); else tmp = Float64(x + Float64(z * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -7.5e-44) || ~((z <= 3.7e-44))) tmp = t / (b - y); else tmp = x + (z * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7.5e-44], N[Not[LessEqual[z, 3.7e-44]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-44} \lor \neg \left(z \leq 3.7 \cdot 10^{-44}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot x\\
\end{array}
\end{array}
if z < -7.50000000000000008e-44 or 3.7e-44 < z Initial program 52.6%
fma-define52.6%
+-commutative52.6%
fma-define52.7%
Simplified52.7%
Taylor expanded in z around inf 80.7%
Taylor expanded in t around inf 42.7%
if -7.50000000000000008e-44 < z < 3.7e-44Initial program 89.3%
fma-define89.3%
+-commutative89.3%
fma-define89.3%
Simplified89.3%
Taylor expanded in y around inf 49.3%
mul-1-neg49.3%
unsub-neg49.3%
Simplified49.3%
Taylor expanded in z around 0 49.3%
Final simplification45.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -23000.0) (not (<= z 1.0))) (/ x (- z)) (+ x (* z x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -23000.0) || !(z <= 1.0)) {
tmp = x / -z;
} else {
tmp = x + (z * 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 <= (-23000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x / -z
else
tmp = x + (z * 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 <= -23000.0) || !(z <= 1.0)) {
tmp = x / -z;
} else {
tmp = x + (z * x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -23000.0) or not (z <= 1.0): tmp = x / -z else: tmp = x + (z * x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -23000.0) || !(z <= 1.0)) tmp = Float64(x / Float64(-z)); else tmp = Float64(x + Float64(z * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -23000.0) || ~((z <= 1.0))) tmp = x / -z; else tmp = x + (z * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -23000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x / (-z)), $MachinePrecision], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -23000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot x\\
\end{array}
\end{array}
if z < -23000 or 1 < z Initial program 45.7%
fma-define45.8%
+-commutative45.8%
fma-define45.8%
Simplified45.8%
Taylor expanded in y around inf 16.2%
mul-1-neg16.2%
unsub-neg16.2%
Simplified16.2%
Taylor expanded in z around inf 16.1%
associate-*r/16.1%
mul-1-neg16.1%
Simplified16.1%
if -23000 < z < 1Initial program 90.2%
fma-define90.2%
+-commutative90.2%
fma-define90.2%
Simplified90.2%
Taylor expanded in y around inf 43.1%
mul-1-neg43.1%
unsub-neg43.1%
Simplified43.1%
Taylor expanded in z around 0 42.8%
Final simplification29.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.8e-46) (not (<= z 510000000000.0))) (/ x (- z)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.8e-46) || !(z <= 510000000000.0)) {
tmp = x / -z;
} 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 <= (-9.8d-46)) .or. (.not. (z <= 510000000000.0d0))) then
tmp = x / -z
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 <= -9.8e-46) || !(z <= 510000000000.0)) {
tmp = x / -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9.8e-46) or not (z <= 510000000000.0): tmp = x / -z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.8e-46) || !(z <= 510000000000.0)) tmp = Float64(x / Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -9.8e-46) || ~((z <= 510000000000.0))) tmp = x / -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.8e-46], N[Not[LessEqual[z, 510000000000.0]], $MachinePrecision]], N[(x / (-z)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{-46} \lor \neg \left(z \leq 510000000000\right):\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.8000000000000002e-46 or 5.1e11 < z Initial program 49.6%
fma-define49.6%
+-commutative49.6%
fma-define49.6%
Simplified49.6%
Taylor expanded in y around inf 15.2%
mul-1-neg15.2%
unsub-neg15.2%
Simplified15.2%
Taylor expanded in z around inf 15.1%
associate-*r/15.1%
mul-1-neg15.1%
Simplified15.1%
if -9.8000000000000002e-46 < z < 5.1e11Initial program 89.4%
fma-define89.4%
+-commutative89.4%
fma-define89.4%
Simplified89.4%
Taylor expanded in z around 0 46.1%
Final simplification29.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 67.8%
fma-define67.8%
+-commutative67.8%
fma-define67.8%
Simplified67.8%
Taylor expanded in z around 0 22.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 2024170
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))