
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))))
(if (or (<= z -1.4e+18) (not (<= z 7.9e-7)))
(+ (* (/ x z) (/ y (- b y))) (/ (- t a) (- b y)))
(* x (+ (/ y t_1) (/ (* z (- t a)) (* x t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if ((z <= -1.4e+18) || !(z <= 7.9e-7)) {
tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y));
} else {
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 = y + (z * (b - y))
if ((z <= (-1.4d+18)) .or. (.not. (z <= 7.9d-7))) then
tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y))
else
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 = y + (z * (b - y));
double tmp;
if ((z <= -1.4e+18) || !(z <= 7.9e-7)) {
tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y));
} else {
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) tmp = 0 if (z <= -1.4e+18) or not (z <= 7.9e-7): tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y)) else: tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) tmp = 0.0 if ((z <= -1.4e+18) || !(z <= 7.9e-7)) tmp = Float64(Float64(Float64(x / z) * Float64(y / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(x * Float64(Float64(y / t_1) + Float64(Float64(z * Float64(t - a)) / Float64(x * t_1)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); tmp = 0.0; if ((z <= -1.4e+18) || ~((z <= 7.9e-7))) tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y)); else tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -1.4e+18], N[Not[LessEqual[z, 7.9e-7]], $MachinePrecision]], N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+18} \lor \neg \left(z \leq 7.9 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{b - y} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{t\_1} + \frac{z \cdot \left(t - a\right)}{x \cdot t\_1}\right)\\
\end{array}
\end{array}
if z < -1.4e18 or 7.89999999999999954e-7 < z Initial program 43.7%
fma-define43.7%
+-commutative43.7%
fma-define43.7%
Simplified43.7%
Taylor expanded in z around -inf 69.5%
associate--l+69.5%
mul-1-neg69.5%
distribute-lft-out--69.5%
associate-/l*73.8%
associate-/l*88.1%
div-sub88.8%
Simplified88.8%
Taylor expanded in x around inf 86.3%
times-frac98.6%
Simplified98.6%
if -1.4e18 < z < 7.89999999999999954e-7Initial program 86.7%
fma-define86.7%
+-commutative86.7%
fma-define86.7%
Simplified86.7%
Taylor expanded in x around inf 89.4%
Final simplification94.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* z (- t a)) (+ y (* z (- b y)))))
(t_2 (+ (* (/ x z) (/ y (- b y))) (/ (- t a) (- b y)))))
(if (<= z -2200.0)
t_2
(if (<= z -2e-126)
t_1
(if (<= z 7e-123) (- x (/ (* z a) y)) (if (<= z 950.0) 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 = ((x / z) * (y / (b - y))) + ((t - a) / (b - y));
double tmp;
if (z <= -2200.0) {
tmp = t_2;
} else if (z <= -2e-126) {
tmp = t_1;
} else if (z <= 7e-123) {
tmp = x - ((z * a) / y);
} else if (z <= 950.0) {
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 = ((x / z) * (y / (b - y))) + ((t - a) / (b - y))
if (z <= (-2200.0d0)) then
tmp = t_2
else if (z <= (-2d-126)) then
tmp = t_1
else if (z <= 7d-123) then
tmp = x - ((z * a) / y)
else if (z <= 950.0d0) 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 = ((x / z) * (y / (b - y))) + ((t - a) / (b - y));
double tmp;
if (z <= -2200.0) {
tmp = t_2;
} else if (z <= -2e-126) {
tmp = t_1;
} else if (z <= 7e-123) {
tmp = x - ((z * a) / y);
} else if (z <= 950.0) {
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 = ((x / z) * (y / (b - y))) + ((t - a) / (b - y)) tmp = 0 if z <= -2200.0: tmp = t_2 elif z <= -2e-126: tmp = t_1 elif z <= 7e-123: tmp = x - ((z * a) / y) elif z <= 950.0: 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(Float64(x / z) * Float64(y / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))) tmp = 0.0 if (z <= -2200.0) tmp = t_2; elseif (z <= -2e-126) tmp = t_1; elseif (z <= 7e-123) tmp = Float64(x - Float64(Float64(z * a) / y)); elseif (z <= 950.0) 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 = ((x / z) * (y / (b - y))) + ((t - a) / (b - y)); tmp = 0.0; if (z <= -2200.0) tmp = t_2; elseif (z <= -2e-126) tmp = t_1; elseif (z <= 7e-123) tmp = x - ((z * a) / y); elseif (z <= 950.0) 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[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2200.0], t$95$2, If[LessEqual[z, -2e-126], t$95$1, If[LessEqual[z, 7e-123], N[(x - N[(N[(z * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 950.0], 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{x}{z} \cdot \frac{y}{b - y} + \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2200:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-123}:\\
\;\;\;\;x - \frac{z \cdot a}{y}\\
\mathbf{elif}\;z \leq 950:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2200 or 950 < z Initial program 43.0%
fma-define43.0%
+-commutative43.0%
fma-define43.0%
Simplified43.0%
Taylor expanded in z around -inf 67.8%
associate--l+67.8%
mul-1-neg67.8%
distribute-lft-out--67.8%
associate-/l*72.4%
associate-/l*88.3%
div-sub89.0%
Simplified89.0%
Taylor expanded in x around inf 86.1%
times-frac98.7%
Simplified98.7%
if -2200 < z < -1.9999999999999999e-126 or 6.9999999999999997e-123 < z < 950Initial program 91.8%
fma-define91.8%
+-commutative91.8%
fma-define91.8%
Simplified91.8%
Taylor expanded in x around 0 77.9%
if -1.9999999999999999e-126 < z < 6.9999999999999997e-123Initial program 84.4%
fma-define84.4%
+-commutative84.4%
fma-define84.4%
Simplified84.4%
Taylor expanded in z around 0 51.1%
Taylor expanded in a around inf 71.4%
mul-1-neg71.4%
Simplified71.4%
Taylor expanded in x around 0 71.4%
Final simplification87.4%
(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 -1.4e+18)
t_2
(if (<= z -1.05e-126)
t_1
(if (<= z 9e-123)
(- x (/ (* z a) y))
(if (<= z 1.3e+28) t_1 (- t_2 (/ x z))))))))
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 <= -1.4e+18) {
tmp = t_2;
} else if (z <= -1.05e-126) {
tmp = t_1;
} else if (z <= 9e-123) {
tmp = x - ((z * a) / y);
} else if (z <= 1.3e+28) {
tmp = t_1;
} else {
tmp = t_2 - (x / z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: 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 <= (-1.4d+18)) then
tmp = t_2
else if (z <= (-1.05d-126)) then
tmp = t_1
else if (z <= 9d-123) then
tmp = x - ((z * a) / y)
else if (z <= 1.3d+28) then
tmp = t_1
else
tmp = t_2 - (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * (t - a)) / (y + (z * (b - y)));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1.4e+18) {
tmp = t_2;
} else if (z <= -1.05e-126) {
tmp = t_1;
} else if (z <= 9e-123) {
tmp = x - ((z * a) / y);
} else if (z <= 1.3e+28) {
tmp = t_1;
} else {
tmp = t_2 - (x / z);
}
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 <= -1.4e+18: tmp = t_2 elif z <= -1.05e-126: tmp = t_1 elif z <= 9e-123: tmp = x - ((z * a) / y) elif z <= 1.3e+28: tmp = t_1 else: tmp = t_2 - (x / z) 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 <= -1.4e+18) tmp = t_2; elseif (z <= -1.05e-126) tmp = t_1; elseif (z <= 9e-123) tmp = Float64(x - Float64(Float64(z * a) / y)); elseif (z <= 1.3e+28) tmp = t_1; else tmp = Float64(t_2 - Float64(x / z)); 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 <= -1.4e+18) tmp = t_2; elseif (z <= -1.05e-126) tmp = t_1; elseif (z <= 9e-123) tmp = x - ((z * a) / y); elseif (z <= 1.3e+28) tmp = t_1; else tmp = t_2 - (x / z); 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, -1.4e+18], t$95$2, If[LessEqual[z, -1.05e-126], t$95$1, If[LessEqual[z, 9e-123], N[(x - N[(N[(z * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+28], t$95$1, N[(t$95$2 - N[(x / z), $MachinePrecision]), $MachinePrecision]]]]]]]
\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 -1.4 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-123}:\\
\;\;\;\;x - \frac{z \cdot a}{y}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2 - \frac{x}{z}\\
\end{array}
\end{array}
if z < -1.4e18Initial program 41.7%
fma-define41.7%
+-commutative41.7%
fma-define41.7%
Simplified41.7%
Taylor expanded in z around inf 87.5%
if -1.4e18 < z < -1.0499999999999999e-126 or 8.99999999999999986e-123 < z < 1.3000000000000001e28Initial program 90.1%
fma-define90.1%
+-commutative90.1%
fma-define90.1%
Simplified90.1%
Taylor expanded in x around 0 75.4%
if -1.0499999999999999e-126 < z < 8.99999999999999986e-123Initial program 84.4%
fma-define84.4%
+-commutative84.4%
fma-define84.4%
Simplified84.4%
Taylor expanded in z around 0 51.1%
Taylor expanded in a around inf 71.4%
mul-1-neg71.4%
Simplified71.4%
Taylor expanded in x around 0 71.4%
if 1.3000000000000001e28 < z Initial program 37.2%
fma-define37.2%
+-commutative37.2%
fma-define37.2%
Simplified37.2%
Taylor expanded in z around -inf 72.1%
associate--l+72.1%
mul-1-neg72.1%
distribute-lft-out--72.1%
associate-/l*73.8%
associate-/l*89.1%
div-sub89.1%
Simplified89.1%
Taylor expanded in y around inf 87.0%
associate-*r/87.0%
mul-1-neg87.0%
Simplified87.0%
Final simplification80.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2060000.0) (not (<= z 800000000000.0))) (+ (* (/ x z) (/ y (- b y))) (/ (- t a) (- b y))) (/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2060000.0) || !(z <= 800000000000.0)) {
tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y));
} else {
tmp = ((z * (t - a)) + (x * y)) / (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 <= (-2060000.0d0)) .or. (.not. (z <= 800000000000.0d0))) then
tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y))
else
tmp = ((z * (t - a)) + (x * y)) / (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 <= -2060000.0) || !(z <= 800000000000.0)) {
tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y));
} else {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2060000.0) or not (z <= 800000000000.0): tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y)) else: tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2060000.0) || !(z <= 800000000000.0)) tmp = Float64(Float64(Float64(x / z) * Float64(y / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / 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 <= -2060000.0) || ~((z <= 800000000000.0))) tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y)); else tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2060000.0], N[Not[LessEqual[z, 800000000000.0]], $MachinePrecision]], N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2060000 \lor \neg \left(z \leq 800000000000\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{b - y} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -2.06e6 or 8e11 < z Initial program 42.6%
fma-define42.6%
+-commutative42.6%
fma-define42.6%
Simplified42.6%
Taylor expanded in z around -inf 67.7%
associate--l+67.7%
mul-1-neg67.7%
distribute-lft-out--67.7%
associate-/l*72.3%
associate-/l*88.4%
div-sub89.1%
Simplified89.1%
Taylor expanded in x around inf 86.1%
times-frac98.8%
Simplified98.8%
if -2.06e6 < z < 8e11Initial program 87.6%
Final simplification93.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -1.15e+107)
t_1
(if (<= y -1.85e+46)
(- x (* a (/ z y)))
(if (<= y -4e-35)
(/ t (- b y))
(if (<= y 1.7e+71) (/ (- 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 <= -1.15e+107) {
tmp = t_1;
} else if (y <= -1.85e+46) {
tmp = x - (a * (z / y));
} else if (y <= -4e-35) {
tmp = t / (b - y);
} else if (y <= 1.7e+71) {
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 <= (-1.15d+107)) then
tmp = t_1
else if (y <= (-1.85d+46)) then
tmp = x - (a * (z / y))
else if (y <= (-4d-35)) then
tmp = t / (b - y)
else if (y <= 1.7d+71) 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 <= -1.15e+107) {
tmp = t_1;
} else if (y <= -1.85e+46) {
tmp = x - (a * (z / y));
} else if (y <= -4e-35) {
tmp = t / (b - y);
} else if (y <= 1.7e+71) {
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 <= -1.15e+107: tmp = t_1 elif y <= -1.85e+46: tmp = x - (a * (z / y)) elif y <= -4e-35: tmp = t / (b - y) elif y <= 1.7e+71: 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 <= -1.15e+107) tmp = t_1; elseif (y <= -1.85e+46) tmp = Float64(x - Float64(a * Float64(z / y))); elseif (y <= -4e-35) tmp = Float64(t / Float64(b - y)); elseif (y <= 1.7e+71) 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 <= -1.15e+107) tmp = t_1; elseif (y <= -1.85e+46) tmp = x - (a * (z / y)); elseif (y <= -4e-35) tmp = t / (b - y); elseif (y <= 1.7e+71) 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, -1.15e+107], t$95$1, If[LessEqual[y, -1.85e+46], N[(x - N[(a * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4e-35], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+71], 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 -1.15 \cdot 10^{+107}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.85 \cdot 10^{+46}:\\
\;\;\;\;x - a \cdot \frac{z}{y}\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-35}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+71}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.15e107 or 1.6999999999999999e71 < y Initial program 42.7%
fma-define42.7%
+-commutative42.7%
fma-define42.7%
Simplified42.7%
Taylor expanded in y around inf 53.8%
mul-1-neg53.8%
unsub-neg53.8%
Simplified53.8%
if -1.15e107 < y < -1.84999999999999995e46Initial program 75.7%
fma-define75.7%
+-commutative75.7%
fma-define75.7%
Simplified75.7%
Taylor expanded in z around 0 58.4%
Taylor expanded in a around inf 59.2%
mul-1-neg59.2%
Simplified59.2%
Taylor expanded in x around 0 59.2%
associate-*r/59.2%
Simplified59.2%
if -1.84999999999999995e46 < y < -4.00000000000000003e-35Initial program 61.1%
fma-define61.1%
+-commutative61.1%
fma-define61.2%
Simplified61.2%
Taylor expanded in z around -inf 66.2%
associate--l+66.2%
mul-1-neg66.2%
distribute-lft-out--66.2%
associate-/l*66.3%
associate-/l*67.4%
div-sub67.3%
Simplified67.3%
Taylor expanded in x around inf 71.1%
times-frac71.1%
Simplified71.1%
Taylor expanded in t around inf 51.4%
if -4.00000000000000003e-35 < y < 1.6999999999999999e71Initial program 75.2%
fma-define75.2%
+-commutative75.2%
fma-define75.2%
Simplified75.2%
Taylor expanded in y around 0 64.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -7.5e+109)
t_1
(if (<= y -3.5e-35)
(/ t (- b y))
(if (<= y 1.7e+71) (/ (- 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.5e+109) {
tmp = t_1;
} else if (y <= -3.5e-35) {
tmp = t / (b - y);
} else if (y <= 1.7e+71) {
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.5d+109)) then
tmp = t_1
else if (y <= (-3.5d-35)) then
tmp = t / (b - y)
else if (y <= 1.7d+71) 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.5e+109) {
tmp = t_1;
} else if (y <= -3.5e-35) {
tmp = t / (b - y);
} else if (y <= 1.7e+71) {
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.5e+109: tmp = t_1 elif y <= -3.5e-35: tmp = t / (b - y) elif y <= 1.7e+71: 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.5e+109) tmp = t_1; elseif (y <= -3.5e-35) tmp = Float64(t / Float64(b - y)); elseif (y <= 1.7e+71) 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.5e+109) tmp = t_1; elseif (y <= -3.5e-35) tmp = t / (b - y); elseif (y <= 1.7e+71) 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.5e+109], t$95$1, If[LessEqual[y, -3.5e-35], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+71], 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.5 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+71}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.50000000000000018e109 or 1.6999999999999999e71 < y Initial program 43.7%
fma-define43.7%
+-commutative43.7%
fma-define43.7%
Simplified43.7%
Taylor expanded in y around inf 55.0%
mul-1-neg55.0%
unsub-neg55.0%
Simplified55.0%
if -7.50000000000000018e109 < y < -3.49999999999999996e-35Initial program 62.6%
fma-define62.6%
+-commutative62.6%
fma-define62.6%
Simplified62.6%
Taylor expanded in z around -inf 47.6%
associate--l+47.6%
mul-1-neg47.6%
distribute-lft-out--47.6%
associate-/l*50.3%
associate-/l*58.6%
div-sub58.6%
Simplified58.6%
Taylor expanded in x around inf 52.3%
times-frac59.0%
Simplified59.0%
Taylor expanded in t around inf 39.1%
if -3.49999999999999996e-35 < y < 1.6999999999999999e71Initial program 75.2%
fma-define75.2%
+-commutative75.2%
fma-define75.2%
Simplified75.2%
Taylor expanded in y around 0 64.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.4e-91) (not (<= z 1.16e-8))) (/ (- t a) (- b y)) (- x (/ (* z a) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.4e-91) || !(z <= 1.16e-8)) {
tmp = (t - a) / (b - y);
} else {
tmp = x - ((z * 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 <= (-9.4d-91)) .or. (.not. (z <= 1.16d-8))) then
tmp = (t - a) / (b - y)
else
tmp = x - ((z * 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 <= -9.4e-91) || !(z <= 1.16e-8)) {
tmp = (t - a) / (b - y);
} else {
tmp = x - ((z * a) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9.4e-91) or not (z <= 1.16e-8): tmp = (t - a) / (b - y) else: tmp = x - ((z * a) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.4e-91) || !(z <= 1.16e-8)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x - Float64(Float64(z * a) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -9.4e-91) || ~((z <= 1.16e-8))) tmp = (t - a) / (b - y); else tmp = x - ((z * a) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.4e-91], N[Not[LessEqual[z, 1.16e-8]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.4 \cdot 10^{-91} \lor \neg \left(z \leq 1.16 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot a}{y}\\
\end{array}
\end{array}
if z < -9.40000000000000013e-91 or 1.15999999999999996e-8 < z Initial program 49.2%
fma-define49.2%
+-commutative49.2%
fma-define49.2%
Simplified49.2%
Taylor expanded in z around inf 81.7%
if -9.40000000000000013e-91 < z < 1.15999999999999996e-8Initial program 86.1%
fma-define86.1%
+-commutative86.1%
fma-define86.2%
Simplified86.2%
Taylor expanded in z around 0 50.6%
Taylor expanded in a around inf 62.6%
mul-1-neg62.6%
Simplified62.6%
Taylor expanded in x around 0 62.6%
Final simplification74.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.05e-90) (not (<= z 3.7e-38))) (/ (- t a) b) (- x (/ (* z a) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.05e-90) || !(z <= 3.7e-38)) {
tmp = (t - a) / b;
} else {
tmp = x - ((z * 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 <= (-1.05d-90)) .or. (.not. (z <= 3.7d-38))) then
tmp = (t - a) / b
else
tmp = x - ((z * 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 <= -1.05e-90) || !(z <= 3.7e-38)) {
tmp = (t - a) / b;
} else {
tmp = x - ((z * a) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.05e-90) or not (z <= 3.7e-38): tmp = (t - a) / b else: tmp = x - ((z * a) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.05e-90) || !(z <= 3.7e-38)) tmp = Float64(Float64(t - a) / b); else tmp = Float64(x - Float64(Float64(z * a) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.05e-90) || ~((z <= 3.7e-38))) tmp = (t - a) / b; else tmp = x - ((z * a) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.05e-90], N[Not[LessEqual[z, 3.7e-38]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], N[(x - N[(N[(z * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-90} \lor \neg \left(z \leq 3.7 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot a}{y}\\
\end{array}
\end{array}
if z < -1.05e-90 or 3.7e-38 < z Initial program 50.5%
fma-define50.5%
+-commutative50.5%
fma-define50.5%
Simplified50.5%
Taylor expanded in y around 0 52.9%
if -1.05e-90 < z < 3.7e-38Initial program 86.3%
fma-define86.3%
+-commutative86.3%
fma-define86.3%
Simplified86.3%
Taylor expanded in z around 0 50.6%
Taylor expanded in a around inf 63.8%
mul-1-neg63.8%
Simplified63.8%
Taylor expanded in x around 0 63.8%
Final simplification56.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.9e-91) (not (<= z 5.4e-9))) (/ t (- b y)) (+ x (* z x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.9e-91) || !(z <= 5.4e-9)) {
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 <= (-5.9d-91)) .or. (.not. (z <= 5.4d-9))) 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 <= -5.9e-91) || !(z <= 5.4e-9)) {
tmp = t / (b - y);
} else {
tmp = x + (z * x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.9e-91) or not (z <= 5.4e-9): tmp = t / (b - y) else: tmp = x + (z * x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.9e-91) || !(z <= 5.4e-9)) 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 <= -5.9e-91) || ~((z <= 5.4e-9))) 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, -5.9e-91], N[Not[LessEqual[z, 5.4e-9]], $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 -5.9 \cdot 10^{-91} \lor \neg \left(z \leq 5.4 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot x\\
\end{array}
\end{array}
if z < -5.90000000000000025e-91 or 5.4000000000000004e-9 < z Initial program 49.2%
fma-define49.2%
+-commutative49.2%
fma-define49.2%
Simplified49.2%
Taylor expanded in z around -inf 65.1%
associate--l+65.1%
mul-1-neg65.1%
distribute-lft-out--65.1%
associate-/l*69.1%
associate-/l*82.5%
div-sub83.2%
Simplified83.2%
Taylor expanded in x around inf 83.2%
times-frac94.3%
Simplified94.3%
Taylor expanded in t around inf 48.2%
if -5.90000000000000025e-91 < z < 5.4000000000000004e-9Initial program 86.1%
fma-define86.1%
+-commutative86.1%
fma-define86.2%
Simplified86.2%
Taylor expanded in z around 0 50.6%
Taylor expanded in y around inf 42.0%
Final simplification45.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2300.0) (not (<= z 0.042))) (/ x (- z)) (+ x (* z x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2300.0) || !(z <= 0.042)) {
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 <= (-2300.0d0)) .or. (.not. (z <= 0.042d0))) 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 <= -2300.0) || !(z <= 0.042)) {
tmp = x / -z;
} else {
tmp = x + (z * x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2300.0) or not (z <= 0.042): tmp = x / -z else: tmp = x + (z * x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2300.0) || !(z <= 0.042)) 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 <= -2300.0) || ~((z <= 0.042))) tmp = x / -z; else tmp = x + (z * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2300.0], N[Not[LessEqual[z, 0.042]], $MachinePrecision]], N[(x / (-z)), $MachinePrecision], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2300 \lor \neg \left(z \leq 0.042\right):\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot x\\
\end{array}
\end{array}
if z < -2300 or 0.0420000000000000026 < z Initial program 43.8%
fma-define43.8%
+-commutative43.8%
fma-define43.8%
Simplified43.8%
Taylor expanded in z around -inf 67.8%
associate--l+67.8%
mul-1-neg67.8%
distribute-lft-out--67.8%
associate-/l*72.4%
associate-/l*87.9%
div-sub88.6%
Simplified88.6%
Taylor expanded in x around inf 85.8%
times-frac98.2%
Simplified98.2%
Taylor expanded in y around inf 12.9%
neg-mul-112.9%
distribute-neg-frac212.9%
Simplified12.9%
if -2300 < z < 0.0420000000000000026Initial program 87.3%
fma-define87.3%
+-commutative87.3%
fma-define87.3%
Simplified87.3%
Taylor expanded in z around 0 48.7%
Taylor expanded in y around inf 37.1%
Final simplification23.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.4e-14) (not (<= z 0.042))) (/ x (- z)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.4e-14) || !(z <= 0.042)) {
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 <= (-6.4d-14)) .or. (.not. (z <= 0.042d0))) 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 <= -6.4e-14) || !(z <= 0.042)) {
tmp = x / -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.4e-14) or not (z <= 0.042): tmp = x / -z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.4e-14) || !(z <= 0.042)) 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 <= -6.4e-14) || ~((z <= 0.042))) tmp = x / -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.4e-14], N[Not[LessEqual[z, 0.042]], $MachinePrecision]], N[(x / (-z)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{-14} \lor \neg \left(z \leq 0.042\right):\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.4000000000000005e-14 or 0.0420000000000000026 < z Initial program 45.3%
fma-define45.3%
+-commutative45.3%
fma-define45.3%
Simplified45.3%
Taylor expanded in z around -inf 66.0%
associate--l+66.0%
mul-1-neg66.0%
distribute-lft-out--66.0%
associate-/l*70.4%
associate-/l*85.7%
div-sub86.4%
Simplified86.4%
Taylor expanded in x around inf 84.4%
times-frac96.5%
Simplified96.5%
Taylor expanded in y around inf 12.6%
neg-mul-112.6%
distribute-neg-frac212.6%
Simplified12.6%
if -6.4000000000000005e-14 < z < 0.0420000000000000026Initial program 86.9%
fma-define86.9%
+-commutative86.9%
fma-define86.9%
Simplified86.9%
Taylor expanded in z around 0 37.9%
Final simplification23.6%
(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 63.3%
fma-define63.3%
+-commutative63.3%
fma-define63.4%
Simplified63.4%
Taylor expanded in z around 0 18.4%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024157
(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)))))