
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
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
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
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
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.5e+184) (not (<= z 1.15e+147))) (/ (- y (/ x z)) a) (/ (- x (* z y)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.5e+184) || !(z <= 1.15e+147)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((z <= (-9.5d+184)) .or. (.not. (z <= 1.15d+147))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (z * y)) / (t - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.5e+184) || !(z <= 1.15e+147)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.5e+184) or not (z <= 1.15e+147): tmp = (y - (x / z)) / a else: tmp = (x - (z * y)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.5e+184) || !(z <= 1.15e+147)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.5e+184) || ~((z <= 1.15e+147))) tmp = (y - (x / z)) / a; else tmp = (x - (z * y)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.5e+184], N[Not[LessEqual[z, 1.15e+147]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+184} \lor \neg \left(z \leq 1.15 \cdot 10^{+147}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -9.4999999999999995e184 or 1.15e147 < z Initial program 55.4%
*-commutative55.4%
Simplified55.4%
Taylor expanded in t around 0 48.5%
mul-1-neg48.5%
*-commutative48.5%
distribute-neg-frac248.5%
*-commutative48.5%
distribute-rgt-neg-in48.5%
Simplified48.5%
Taylor expanded in x around 0 81.8%
+-commutative81.8%
mul-1-neg81.8%
unsub-neg81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in y around 0 81.8%
+-commutative81.8%
metadata-eval81.8%
*-commutative81.8%
cancel-sign-sub-inv81.8%
*-lft-identity81.8%
associate-/r*88.2%
div-sub88.2%
Simplified88.2%
if -9.4999999999999995e184 < z < 1.15e147Initial program 95.0%
Final simplification93.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y (- (* z a) t)))) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -4.6e+98)
t_2
(if (<= z -5.3e-9)
t_1
(if (<= z -5e-57)
(/ x (- t (* z a)))
(if (<= z -2.15e-108)
t_1
(if (<= z 3.3e-31) (/ (- x (* z y)) t) t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / ((z * a) - t));
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -4.6e+98) {
tmp = t_2;
} else if (z <= -5.3e-9) {
tmp = t_1;
} else if (z <= -5e-57) {
tmp = x / (t - (z * a));
} else if (z <= -2.15e-108) {
tmp = t_1;
} else if (z <= 3.3e-31) {
tmp = (x - (z * y)) / t;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * (y / ((z * a) - t))
t_2 = (y - (x / z)) / a
if (z <= (-4.6d+98)) then
tmp = t_2
else if (z <= (-5.3d-9)) then
tmp = t_1
else if (z <= (-5d-57)) then
tmp = x / (t - (z * a))
else if (z <= (-2.15d-108)) then
tmp = t_1
else if (z <= 3.3d-31) then
tmp = (x - (z * y)) / t
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 t_1 = z * (y / ((z * a) - t));
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -4.6e+98) {
tmp = t_2;
} else if (z <= -5.3e-9) {
tmp = t_1;
} else if (z <= -5e-57) {
tmp = x / (t - (z * a));
} else if (z <= -2.15e-108) {
tmp = t_1;
} else if (z <= 3.3e-31) {
tmp = (x - (z * y)) / t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / ((z * a) - t)) t_2 = (y - (x / z)) / a tmp = 0 if z <= -4.6e+98: tmp = t_2 elif z <= -5.3e-9: tmp = t_1 elif z <= -5e-57: tmp = x / (t - (z * a)) elif z <= -2.15e-108: tmp = t_1 elif z <= 3.3e-31: tmp = (x - (z * y)) / t else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(Float64(z * a) - t))) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -4.6e+98) tmp = t_2; elseif (z <= -5.3e-9) tmp = t_1; elseif (z <= -5e-57) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= -2.15e-108) tmp = t_1; elseif (z <= 3.3e-31) tmp = Float64(Float64(x - Float64(z * y)) / t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / ((z * a) - t)); t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -4.6e+98) tmp = t_2; elseif (z <= -5.3e-9) tmp = t_1; elseif (z <= -5e-57) tmp = x / (t - (z * a)); elseif (z <= -2.15e-108) tmp = t_1; elseif (z <= 3.3e-31) tmp = (x - (z * y)) / t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -4.6e+98], t$95$2, If[LessEqual[z, -5.3e-9], t$95$1, If[LessEqual[z, -5e-57], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.15e-108], t$95$1, If[LessEqual[z, 3.3e-31], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{z \cdot a - t}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+98}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -5.3 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-57}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-31}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.60000000000000026e98 or 3.2999999999999999e-31 < z Initial program 71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in t around 0 50.6%
mul-1-neg50.6%
*-commutative50.6%
distribute-neg-frac250.6%
*-commutative50.6%
distribute-rgt-neg-in50.6%
Simplified50.6%
Taylor expanded in x around 0 71.4%
+-commutative71.4%
mul-1-neg71.4%
unsub-neg71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y around 0 71.4%
+-commutative71.4%
metadata-eval71.4%
*-commutative71.4%
cancel-sign-sub-inv71.4%
*-lft-identity71.4%
associate-/r*75.2%
div-sub75.2%
Simplified75.2%
if -4.60000000000000026e98 < z < -5.30000000000000031e-9 or -5.0000000000000002e-57 < z < -2.15e-108Initial program 97.3%
*-commutative97.3%
Simplified97.3%
Taylor expanded in x around 0 74.3%
mul-1-neg74.3%
distribute-neg-frac274.3%
sub-neg74.3%
+-commutative74.3%
distribute-neg-in74.3%
unsub-neg74.3%
*-commutative74.3%
remove-double-neg74.3%
Simplified74.3%
Taylor expanded in y around 0 74.3%
*-commutative74.3%
associate-*r/76.8%
*-commutative76.8%
Simplified76.8%
if -5.30000000000000031e-9 < z < -5.0000000000000002e-57Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 89.6%
*-commutative89.6%
Simplified89.6%
if -2.15e-108 < z < 3.2999999999999999e-31Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 85.1%
Final simplification79.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -2.6e+101)
t_2
(if (<= z -6.6e-7)
(* z (/ y t_1))
(if (<= z -3.1e-61)
(/ x (- t (* z a)))
(if (<= z -2.15e-108)
(/ (* z y) t_1)
(if (<= z 2.5e-31) (/ (- x (* z y)) t) t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -2.6e+101) {
tmp = t_2;
} else if (z <= -6.6e-7) {
tmp = z * (y / t_1);
} else if (z <= -3.1e-61) {
tmp = x / (t - (z * a));
} else if (z <= -2.15e-108) {
tmp = (z * y) / t_1;
} else if (z <= 2.5e-31) {
tmp = (x - (z * y)) / t;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * a) - t
t_2 = (y - (x / z)) / a
if (z <= (-2.6d+101)) then
tmp = t_2
else if (z <= (-6.6d-7)) then
tmp = z * (y / t_1)
else if (z <= (-3.1d-61)) then
tmp = x / (t - (z * a))
else if (z <= (-2.15d-108)) then
tmp = (z * y) / t_1
else if (z <= 2.5d-31) then
tmp = (x - (z * y)) / t
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 t_1 = (z * a) - t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -2.6e+101) {
tmp = t_2;
} else if (z <= -6.6e-7) {
tmp = z * (y / t_1);
} else if (z <= -3.1e-61) {
tmp = x / (t - (z * a));
} else if (z <= -2.15e-108) {
tmp = (z * y) / t_1;
} else if (z <= 2.5e-31) {
tmp = (x - (z * y)) / t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = (y - (x / z)) / a tmp = 0 if z <= -2.6e+101: tmp = t_2 elif z <= -6.6e-7: tmp = z * (y / t_1) elif z <= -3.1e-61: tmp = x / (t - (z * a)) elif z <= -2.15e-108: tmp = (z * y) / t_1 elif z <= 2.5e-31: tmp = (x - (z * y)) / t else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -2.6e+101) tmp = t_2; elseif (z <= -6.6e-7) tmp = Float64(z * Float64(y / t_1)); elseif (z <= -3.1e-61) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= -2.15e-108) tmp = Float64(Float64(z * y) / t_1); elseif (z <= 2.5e-31) tmp = Float64(Float64(x - Float64(z * y)) / t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -2.6e+101) tmp = t_2; elseif (z <= -6.6e-7) tmp = z * (y / t_1); elseif (z <= -3.1e-61) tmp = x / (t - (z * a)); elseif (z <= -2.15e-108) tmp = (z * y) / t_1; elseif (z <= 2.5e-31) tmp = (x - (z * y)) / t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -2.6e+101], t$95$2, If[LessEqual[z, -6.6e-7], N[(z * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.1e-61], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.15e-108], N[(N[(z * y), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 2.5e-31], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+101}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-7}:\\
\;\;\;\;z \cdot \frac{y}{t\_1}\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-61}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-108}:\\
\;\;\;\;\frac{z \cdot y}{t\_1}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-31}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.6e101 or 2.5e-31 < z Initial program 71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in t around 0 50.6%
mul-1-neg50.6%
*-commutative50.6%
distribute-neg-frac250.6%
*-commutative50.6%
distribute-rgt-neg-in50.6%
Simplified50.6%
Taylor expanded in x around 0 71.4%
+-commutative71.4%
mul-1-neg71.4%
unsub-neg71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y around 0 71.4%
+-commutative71.4%
metadata-eval71.4%
*-commutative71.4%
cancel-sign-sub-inv71.4%
*-lft-identity71.4%
associate-/r*75.2%
div-sub75.2%
Simplified75.2%
if -2.6e101 < z < -6.6000000000000003e-7Initial program 95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in x around 0 76.6%
mul-1-neg76.6%
distribute-neg-frac276.6%
sub-neg76.6%
+-commutative76.6%
distribute-neg-in76.6%
unsub-neg76.6%
*-commutative76.6%
remove-double-neg76.6%
Simplified76.6%
Taylor expanded in y around 0 76.6%
*-commutative76.6%
associate-*r/80.6%
*-commutative80.6%
Simplified80.6%
if -6.6000000000000003e-7 < z < -3.09999999999999995e-61Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 83.3%
*-commutative83.3%
Simplified83.3%
if -3.09999999999999995e-61 < z < -2.15e-108Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 73.7%
mul-1-neg73.7%
distribute-neg-frac273.7%
sub-neg73.7%
+-commutative73.7%
distribute-neg-in73.7%
unsub-neg73.7%
*-commutative73.7%
remove-double-neg73.7%
Simplified73.7%
if -2.15e-108 < z < 2.5e-31Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 85.1%
Final simplification79.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -5.3e+98)
t_2
(if (<= z -1.42e-6)
(* y (/ z t_1))
(if (<= z -6.8e-62)
(/ x (- t (* z a)))
(if (<= z -1.95e-105)
(/ (* z y) t_1)
(if (<= z 2.3e-32) (/ (- x (* z y)) t) t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -5.3e+98) {
tmp = t_2;
} else if (z <= -1.42e-6) {
tmp = y * (z / t_1);
} else if (z <= -6.8e-62) {
tmp = x / (t - (z * a));
} else if (z <= -1.95e-105) {
tmp = (z * y) / t_1;
} else if (z <= 2.3e-32) {
tmp = (x - (z * y)) / t;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * a) - t
t_2 = (y - (x / z)) / a
if (z <= (-5.3d+98)) then
tmp = t_2
else if (z <= (-1.42d-6)) then
tmp = y * (z / t_1)
else if (z <= (-6.8d-62)) then
tmp = x / (t - (z * a))
else if (z <= (-1.95d-105)) then
tmp = (z * y) / t_1
else if (z <= 2.3d-32) then
tmp = (x - (z * y)) / t
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 t_1 = (z * a) - t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -5.3e+98) {
tmp = t_2;
} else if (z <= -1.42e-6) {
tmp = y * (z / t_1);
} else if (z <= -6.8e-62) {
tmp = x / (t - (z * a));
} else if (z <= -1.95e-105) {
tmp = (z * y) / t_1;
} else if (z <= 2.3e-32) {
tmp = (x - (z * y)) / t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = (y - (x / z)) / a tmp = 0 if z <= -5.3e+98: tmp = t_2 elif z <= -1.42e-6: tmp = y * (z / t_1) elif z <= -6.8e-62: tmp = x / (t - (z * a)) elif z <= -1.95e-105: tmp = (z * y) / t_1 elif z <= 2.3e-32: tmp = (x - (z * y)) / t else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -5.3e+98) tmp = t_2; elseif (z <= -1.42e-6) tmp = Float64(y * Float64(z / t_1)); elseif (z <= -6.8e-62) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= -1.95e-105) tmp = Float64(Float64(z * y) / t_1); elseif (z <= 2.3e-32) tmp = Float64(Float64(x - Float64(z * y)) / t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -5.3e+98) tmp = t_2; elseif (z <= -1.42e-6) tmp = y * (z / t_1); elseif (z <= -6.8e-62) tmp = x / (t - (z * a)); elseif (z <= -1.95e-105) tmp = (z * y) / t_1; elseif (z <= 2.3e-32) tmp = (x - (z * y)) / t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -5.3e+98], t$95$2, If[LessEqual[z, -1.42e-6], N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.8e-62], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.95e-105], N[(N[(z * y), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 2.3e-32], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -5.3 \cdot 10^{+98}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{-6}:\\
\;\;\;\;y \cdot \frac{z}{t\_1}\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-62}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-105}:\\
\;\;\;\;\frac{z \cdot y}{t\_1}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -5.29999999999999997e98 or 2.3000000000000001e-32 < z Initial program 71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in t around 0 50.6%
mul-1-neg50.6%
*-commutative50.6%
distribute-neg-frac250.6%
*-commutative50.6%
distribute-rgt-neg-in50.6%
Simplified50.6%
Taylor expanded in x around 0 71.4%
+-commutative71.4%
mul-1-neg71.4%
unsub-neg71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y around 0 71.4%
+-commutative71.4%
metadata-eval71.4%
*-commutative71.4%
cancel-sign-sub-inv71.4%
*-lft-identity71.4%
associate-/r*75.2%
div-sub75.2%
Simplified75.2%
if -5.29999999999999997e98 < z < -1.42e-6Initial program 95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in x around 0 76.6%
associate-/l*80.7%
associate-*r*80.7%
neg-mul-180.7%
*-commutative80.7%
Simplified80.7%
if -1.42e-6 < z < -6.79999999999999975e-62Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 83.3%
*-commutative83.3%
Simplified83.3%
if -6.79999999999999975e-62 < z < -1.95e-105Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 73.7%
mul-1-neg73.7%
distribute-neg-frac273.7%
sub-neg73.7%
+-commutative73.7%
distribute-neg-in73.7%
unsub-neg73.7%
*-commutative73.7%
remove-double-neg73.7%
Simplified73.7%
if -1.95e-105 < z < 2.3000000000000001e-32Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 85.1%
Final simplification79.5%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -1.7e+70)
(and (not (<= z 1.5e+56))
(or (<= z 1.75e+117) (not (<= z 8.5e+131)))))
(/ y a)
(/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e+70) || (!(z <= 1.5e+56) && ((z <= 1.75e+117) || !(z <= 8.5e+131)))) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((z <= (-1.7d+70)) .or. (.not. (z <= 1.5d+56)) .and. (z <= 1.75d+117) .or. (.not. (z <= 8.5d+131))) then
tmp = y / a
else
tmp = x / (t - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e+70) || (!(z <= 1.5e+56) && ((z <= 1.75e+117) || !(z <= 8.5e+131)))) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e+70) or (not (z <= 1.5e+56) and ((z <= 1.75e+117) or not (z <= 8.5e+131))): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e+70) || (!(z <= 1.5e+56) && ((z <= 1.75e+117) || !(z <= 8.5e+131)))) tmp = Float64(y / a); else tmp = Float64(x / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.7e+70) || (~((z <= 1.5e+56)) && ((z <= 1.75e+117) || ~((z <= 8.5e+131))))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e+70], And[N[Not[LessEqual[z, 1.5e+56]], $MachinePrecision], Or[LessEqual[z, 1.75e+117], N[Not[LessEqual[z, 8.5e+131]], $MachinePrecision]]]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+70} \lor \neg \left(z \leq 1.5 \cdot 10^{+56}\right) \land \left(z \leq 1.75 \cdot 10^{+117} \lor \neg \left(z \leq 8.5 \cdot 10^{+131}\right)\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -1.7e70 or 1.50000000000000003e56 < z < 1.74999999999999991e117 or 8.50000000000000063e131 < z Initial program 64.6%
*-commutative64.6%
Simplified64.6%
Taylor expanded in z around inf 63.7%
if -1.7e70 < z < 1.50000000000000003e56 or 1.74999999999999991e117 < z < 8.50000000000000063e131Initial program 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x around inf 68.8%
*-commutative68.8%
Simplified68.8%
Final simplification66.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= a -8e+217)
(/ y a)
(if (<= a -5.2e-52)
t_1
(if (<= a 2.35e-32)
(/ (- x (* z y)) t)
(if (<= a 1.5e+197) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (a <= -8e+217) {
tmp = y / a;
} else if (a <= -5.2e-52) {
tmp = t_1;
} else if (a <= 2.35e-32) {
tmp = (x - (z * y)) / t;
} else if (a <= 1.5e+197) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = x / (t - (z * a))
if (a <= (-8d+217)) then
tmp = y / a
else if (a <= (-5.2d-52)) then
tmp = t_1
else if (a <= 2.35d-32) then
tmp = (x - (z * y)) / t
else if (a <= 1.5d+197) then
tmp = t_1
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (a <= -8e+217) {
tmp = y / a;
} else if (a <= -5.2e-52) {
tmp = t_1;
} else if (a <= 2.35e-32) {
tmp = (x - (z * y)) / t;
} else if (a <= 1.5e+197) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if a <= -8e+217: tmp = y / a elif a <= -5.2e-52: tmp = t_1 elif a <= 2.35e-32: tmp = (x - (z * y)) / t elif a <= 1.5e+197: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (a <= -8e+217) tmp = Float64(y / a); elseif (a <= -5.2e-52) tmp = t_1; elseif (a <= 2.35e-32) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (a <= 1.5e+197) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (a <= -8e+217) tmp = y / a; elseif (a <= -5.2e-52) tmp = t_1; elseif (a <= 2.35e-32) tmp = (x - (z * y)) / t; elseif (a <= 1.5e+197) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8e+217], N[(y / a), $MachinePrecision], If[LessEqual[a, -5.2e-52], t$95$1, If[LessEqual[a, 2.35e-32], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 1.5e+197], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;a \leq -8 \cdot 10^{+217}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;a \leq -5.2 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-32}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+197}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if a < -7.99999999999999968e217 or 1.5000000000000001e197 < a Initial program 65.6%
*-commutative65.6%
Simplified65.6%
Taylor expanded in z around inf 72.6%
if -7.99999999999999968e217 < a < -5.1999999999999997e-52 or 2.3500000000000001e-32 < a < 1.5000000000000001e197Initial program 84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in x around inf 61.6%
*-commutative61.6%
Simplified61.6%
if -5.1999999999999997e-52 < a < 2.3500000000000001e-32Initial program 96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in t around inf 74.3%
Final simplification68.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.25e-6)
(/ y a)
(if (<= z 3.7e-118)
(/ x t)
(if (<= z 9.5e-80)
(/ (* z y) (- t))
(if (<= z 4.4e+33) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.25e-6) {
tmp = y / a;
} else if (z <= 3.7e-118) {
tmp = x / t;
} else if (z <= 9.5e-80) {
tmp = (z * y) / -t;
} else if (z <= 4.4e+33) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (z <= (-2.25d-6)) then
tmp = y / a
else if (z <= 3.7d-118) then
tmp = x / t
else if (z <= 9.5d-80) then
tmp = (z * y) / -t
else if (z <= 4.4d+33) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.25e-6) {
tmp = y / a;
} else if (z <= 3.7e-118) {
tmp = x / t;
} else if (z <= 9.5e-80) {
tmp = (z * y) / -t;
} else if (z <= 4.4e+33) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.25e-6: tmp = y / a elif z <= 3.7e-118: tmp = x / t elif z <= 9.5e-80: tmp = (z * y) / -t elif z <= 4.4e+33: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.25e-6) tmp = Float64(y / a); elseif (z <= 3.7e-118) tmp = Float64(x / t); elseif (z <= 9.5e-80) tmp = Float64(Float64(z * y) / Float64(-t)); elseif (z <= 4.4e+33) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.25e-6) tmp = y / a; elseif (z <= 3.7e-118) tmp = x / t; elseif (z <= 9.5e-80) tmp = (z * y) / -t; elseif (z <= 4.4e+33) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.25e-6], N[(y / a), $MachinePrecision], If[LessEqual[z, 3.7e-118], N[(x / t), $MachinePrecision], If[LessEqual[z, 9.5e-80], N[(N[(z * y), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 4.4e+33], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{-6}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-118}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{z \cdot y}{-t}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.25000000000000006e-6 or 4.39999999999999988e33 < z Initial program 72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in z around inf 56.8%
if -2.25000000000000006e-6 < z < 3.70000000000000014e-118 or 9.5000000000000003e-80 < z < 4.39999999999999988e33Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 55.5%
if 3.70000000000000014e-118 < z < 9.5000000000000003e-80Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x around 0 63.2%
mul-1-neg63.2%
distribute-neg-frac263.2%
sub-neg63.2%
+-commutative63.2%
distribute-neg-in63.2%
unsub-neg63.2%
*-commutative63.2%
remove-double-neg63.2%
Simplified63.2%
Taylor expanded in z around 0 62.7%
associate-*r/62.7%
*-commutative62.7%
neg-mul-162.7%
*-commutative62.7%
distribute-rgt-neg-in62.7%
Simplified62.7%
Final simplification56.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e-10) (not (<= z 1.2e-31))) (/ (- y (/ x z)) a) (/ (- x (* z y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e-10) || !(z <= 1.2e-31)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((z <= (-1.85d-10)) .or. (.not. (z <= 1.2d-31))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (z * y)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e-10) || !(z <= 1.2e-31)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e-10) or not (z <= 1.2e-31): tmp = (y - (x / z)) / a else: tmp = (x - (z * y)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e-10) || !(z <= 1.2e-31)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.85e-10) || ~((z <= 1.2e-31))) tmp = (y - (x / z)) / a; else tmp = (x - (z * y)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e-10], N[Not[LessEqual[z, 1.2e-31]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-10} \lor \neg \left(z \leq 1.2 \cdot 10^{-31}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\end{array}
\end{array}
if z < -1.85000000000000007e-10 or 1.2e-31 < z Initial program 75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in t around 0 51.5%
mul-1-neg51.5%
*-commutative51.5%
distribute-neg-frac251.5%
*-commutative51.5%
distribute-rgt-neg-in51.5%
Simplified51.5%
Taylor expanded in x around 0 68.8%
+-commutative68.8%
mul-1-neg68.8%
unsub-neg68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in y around 0 68.8%
+-commutative68.8%
metadata-eval68.8%
*-commutative68.8%
cancel-sign-sub-inv68.8%
*-lft-identity68.8%
associate-/r*72.0%
div-sub72.2%
Simplified72.2%
if -1.85000000000000007e-10 < z < 1.2e-31Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 78.9%
Final simplification75.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e-8) (not (<= z 4.5e+33))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e-8) || !(z <= 4.5e+33)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((z <= (-2.4d-8)) .or. (.not. (z <= 4.5d+33))) then
tmp = y / a
else
tmp = x / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e-8) || !(z <= 4.5e+33)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e-8) or not (z <= 4.5e+33): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.4e-8) || !(z <= 4.5e+33)) tmp = Float64(y / a); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.4e-8) || ~((z <= 4.5e+33))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.4e-8], N[Not[LessEqual[z, 4.5e+33]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-8} \lor \neg \left(z \leq 4.5 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -2.39999999999999998e-8 or 4.5e33 < z Initial program 72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in z around inf 56.8%
if -2.39999999999999998e-8 < z < 4.5e33Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 52.3%
Final simplification54.6%
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
return x / t;
}
real(8) function code(x, y, z, t, a)
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
code = x / t
end function
public static double code(double x, double y, double z, double t, double a) {
return x / t;
}
def code(x, y, z, t, a): return x / t
function code(x, y, z, t, a) return Float64(x / t) end
function tmp = code(x, y, z, t, a) tmp = x / t; end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t}
\end{array}
Initial program 86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in z around 0 33.7%
Final simplification33.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
(if (< z -32113435955957344.0)
t_2
(if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (a * z)
t_2 = (x / t_1) - (y / ((t / z) - a))
if (z < (-32113435955957344.0d0)) then
tmp = t_2
else if (z < 3.5139522372978296d-86) then
tmp = (x - (y * z)) * (1.0d0 / 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 t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) t_2 = (x / t_1) - (y / ((t / z) - a)) tmp = 0 if z < -32113435955957344.0: tmp = t_2 elif z < 3.5139522372978296e-86: tmp = (x - (y * z)) * (1.0 / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))) tmp = 0.0 if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); t_2 = (x / t_1) - (y / ((t / z) - a)); tmp = 0.0; if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = (x - (y * z)) * (1.0 / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024045
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))