
(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 (- (/ y (- a (/ t z))) (/ x (- (* a z) t))))
double code(double x, double y, double z, double t, double a) {
return (y / (a - (t / z))) - (x / ((a * z) - 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 = (y / (a - (t / z))) - (x / ((a * z) - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (y / (a - (t / z))) - (x / ((a * z) - t));
}
def code(x, y, z, t, a): return (y / (a - (t / z))) - (x / ((a * z) - t))
function code(x, y, z, t, a) return Float64(Float64(y / Float64(a - Float64(t / z))) - Float64(x / Float64(Float64(a * z) - t))) end
function tmp = code(x, y, z, t, a) tmp = (y / (a - (t / z))) - (x / ((a * z) - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(a * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{a - \frac{t}{z}} - \frac{x}{a \cdot z - t}
\end{array}
Initial program 87.1%
sub-neg87.1%
+-commutative87.1%
neg-sub087.1%
associate-+l-87.1%
sub0-neg87.1%
neg-mul-187.1%
sub-neg87.1%
+-commutative87.1%
neg-sub087.1%
associate-+l-87.1%
sub0-neg87.1%
neg-mul-187.1%
times-frac87.1%
metadata-eval87.1%
*-lft-identity87.1%
*-commutative87.1%
Simplified87.1%
div-sub86.7%
associate-/l*89.8%
Applied egg-rr89.8%
Taylor expanded in z around 0 95.0%
neg-mul-195.0%
unsub-neg95.0%
Simplified95.0%
Final simplification95.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) t))
(t_2 (/ (- y (/ x z)) a))
(t_3 (/ (- x) (- (* a z) t))))
(if (<= z -2.15e+16)
t_2
(if (<= z -1.3e-171)
t_1
(if (<= z 3.1e-281)
t_3
(if (<= z 2.8e-120)
t_1
(if (<= z 3.2e-92)
t_2
(if (or (<= z 1.28e-30)
(and (not (<= z 1.16e-8)) (<= z 24500000000.0)))
t_3
(/ y (- a (/ t z)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / t;
double t_2 = (y - (x / z)) / a;
double t_3 = -x / ((a * z) - t);
double tmp;
if (z <= -2.15e+16) {
tmp = t_2;
} else if (z <= -1.3e-171) {
tmp = t_1;
} else if (z <= 3.1e-281) {
tmp = t_3;
} else if (z <= 2.8e-120) {
tmp = t_1;
} else if (z <= 3.2e-92) {
tmp = t_2;
} else if ((z <= 1.28e-30) || (!(z <= 1.16e-8) && (z <= 24500000000.0))) {
tmp = t_3;
} else {
tmp = y / (a - (t / z));
}
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) :: t_3
real(8) :: tmp
t_1 = (x - (y * z)) / t
t_2 = (y - (x / z)) / a
t_3 = -x / ((a * z) - t)
if (z <= (-2.15d+16)) then
tmp = t_2
else if (z <= (-1.3d-171)) then
tmp = t_1
else if (z <= 3.1d-281) then
tmp = t_3
else if (z <= 2.8d-120) then
tmp = t_1
else if (z <= 3.2d-92) then
tmp = t_2
else if ((z <= 1.28d-30) .or. (.not. (z <= 1.16d-8)) .and. (z <= 24500000000.0d0)) then
tmp = t_3
else
tmp = y / (a - (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / t;
double t_2 = (y - (x / z)) / a;
double t_3 = -x / ((a * z) - t);
double tmp;
if (z <= -2.15e+16) {
tmp = t_2;
} else if (z <= -1.3e-171) {
tmp = t_1;
} else if (z <= 3.1e-281) {
tmp = t_3;
} else if (z <= 2.8e-120) {
tmp = t_1;
} else if (z <= 3.2e-92) {
tmp = t_2;
} else if ((z <= 1.28e-30) || (!(z <= 1.16e-8) && (z <= 24500000000.0))) {
tmp = t_3;
} else {
tmp = y / (a - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / t t_2 = (y - (x / z)) / a t_3 = -x / ((a * z) - t) tmp = 0 if z <= -2.15e+16: tmp = t_2 elif z <= -1.3e-171: tmp = t_1 elif z <= 3.1e-281: tmp = t_3 elif z <= 2.8e-120: tmp = t_1 elif z <= 3.2e-92: tmp = t_2 elif (z <= 1.28e-30) or (not (z <= 1.16e-8) and (z <= 24500000000.0)): tmp = t_3 else: tmp = y / (a - (t / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / t) t_2 = Float64(Float64(y - Float64(x / z)) / a) t_3 = Float64(Float64(-x) / Float64(Float64(a * z) - t)) tmp = 0.0 if (z <= -2.15e+16) tmp = t_2; elseif (z <= -1.3e-171) tmp = t_1; elseif (z <= 3.1e-281) tmp = t_3; elseif (z <= 2.8e-120) tmp = t_1; elseif (z <= 3.2e-92) tmp = t_2; elseif ((z <= 1.28e-30) || (!(z <= 1.16e-8) && (z <= 24500000000.0))) tmp = t_3; else tmp = Float64(y / Float64(a - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (y * z)) / t; t_2 = (y - (x / z)) / a; t_3 = -x / ((a * z) - t); tmp = 0.0; if (z <= -2.15e+16) tmp = t_2; elseif (z <= -1.3e-171) tmp = t_1; elseif (z <= 3.1e-281) tmp = t_3; elseif (z <= 2.8e-120) tmp = t_1; elseif (z <= 3.2e-92) tmp = t_2; elseif ((z <= 1.28e-30) || (~((z <= 1.16e-8)) && (z <= 24500000000.0))) tmp = t_3; else tmp = y / (a - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[((-x) / N[(N[(a * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.15e+16], t$95$2, If[LessEqual[z, -1.3e-171], t$95$1, If[LessEqual[z, 3.1e-281], t$95$3, If[LessEqual[z, 2.8e-120], t$95$1, If[LessEqual[z, 3.2e-92], t$95$2, If[Or[LessEqual[z, 1.28e-30], And[N[Not[LessEqual[z, 1.16e-8]], $MachinePrecision], LessEqual[z, 24500000000.0]]], t$95$3, N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
t_3 := \frac{-x}{a \cdot z - t}\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{+16}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-171}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-281}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-120}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-92}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{-30} \lor \neg \left(z \leq 1.16 \cdot 10^{-8}\right) \land z \leq 24500000000:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\end{array}
\end{array}
if z < -2.15e16 or 2.79999999999999994e-120 < z < 3.1999999999999997e-92Initial program 74.4%
sub-neg74.4%
+-commutative74.4%
neg-sub074.4%
associate-+l-74.4%
sub0-neg74.4%
neg-mul-174.4%
sub-neg74.4%
+-commutative74.4%
neg-sub074.4%
associate-+l-74.4%
sub0-neg74.4%
neg-mul-174.4%
times-frac74.4%
metadata-eval74.4%
*-lft-identity74.4%
*-commutative74.4%
Simplified74.4%
div-sub74.4%
associate-/l*84.4%
Applied egg-rr84.4%
Taylor expanded in a around inf 84.3%
if -2.15e16 < z < -1.30000000000000002e-171 or 3.1000000000000002e-281 < z < 2.79999999999999994e-120Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in a around 0 77.9%
associate-*r/77.9%
neg-mul-177.9%
neg-sub077.9%
sub-neg77.9%
+-commutative77.9%
associate--r+77.9%
neg-sub077.9%
remove-double-neg77.9%
*-commutative77.9%
Simplified77.9%
if -1.30000000000000002e-171 < z < 3.1000000000000002e-281 or 3.1999999999999997e-92 < z < 1.28000000000000007e-30 or 1.15999999999999996e-8 < z < 2.45e10Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 86.6%
neg-mul-186.6%
Simplified86.6%
if 1.28000000000000007e-30 < z < 1.15999999999999996e-8 or 2.45e10 < z Initial program 75.1%
sub-neg75.1%
+-commutative75.1%
neg-sub075.1%
associate-+l-75.1%
sub0-neg75.1%
neg-mul-175.1%
sub-neg75.1%
+-commutative75.1%
neg-sub075.1%
associate-+l-75.1%
sub0-neg75.1%
neg-mul-175.1%
times-frac75.1%
metadata-eval75.1%
*-lft-identity75.1%
*-commutative75.1%
Simplified75.1%
div-sub75.2%
associate-/l*83.0%
Applied egg-rr83.0%
Taylor expanded in z around 0 96.6%
neg-mul-196.6%
unsub-neg96.6%
Simplified96.6%
Taylor expanded in y around inf 79.7%
Final simplification81.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)) (t_2 (/ (- x) (- (* a z) t))))
(if (<= z -3e+16)
t_1
(if (<= z -5.2e-175)
(* (/ -1.0 t) (- (* y z) x))
(if (<= z 3.35e-281)
t_2
(if (<= z 2.35e-120)
(/ (- x (* y z)) t)
(if (<= z 3.2e-92)
t_1
(if (or (<= z 8.5e-34)
(and (not (<= z 2.65e-8)) (<= z 23000000000.0)))
t_2
(/ y (- a (/ t z)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double t_2 = -x / ((a * z) - t);
double tmp;
if (z <= -3e+16) {
tmp = t_1;
} else if (z <= -5.2e-175) {
tmp = (-1.0 / t) * ((y * z) - x);
} else if (z <= 3.35e-281) {
tmp = t_2;
} else if (z <= 2.35e-120) {
tmp = (x - (y * z)) / t;
} else if (z <= 3.2e-92) {
tmp = t_1;
} else if ((z <= 8.5e-34) || (!(z <= 2.65e-8) && (z <= 23000000000.0))) {
tmp = t_2;
} else {
tmp = y / (a - (t / z));
}
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 = (y - (x / z)) / a
t_2 = -x / ((a * z) - t)
if (z <= (-3d+16)) then
tmp = t_1
else if (z <= (-5.2d-175)) then
tmp = ((-1.0d0) / t) * ((y * z) - x)
else if (z <= 3.35d-281) then
tmp = t_2
else if (z <= 2.35d-120) then
tmp = (x - (y * z)) / t
else if (z <= 3.2d-92) then
tmp = t_1
else if ((z <= 8.5d-34) .or. (.not. (z <= 2.65d-8)) .and. (z <= 23000000000.0d0)) then
tmp = t_2
else
tmp = y / (a - (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double t_2 = -x / ((a * z) - t);
double tmp;
if (z <= -3e+16) {
tmp = t_1;
} else if (z <= -5.2e-175) {
tmp = (-1.0 / t) * ((y * z) - x);
} else if (z <= 3.35e-281) {
tmp = t_2;
} else if (z <= 2.35e-120) {
tmp = (x - (y * z)) / t;
} else if (z <= 3.2e-92) {
tmp = t_1;
} else if ((z <= 8.5e-34) || (!(z <= 2.65e-8) && (z <= 23000000000.0))) {
tmp = t_2;
} else {
tmp = y / (a - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a t_2 = -x / ((a * z) - t) tmp = 0 if z <= -3e+16: tmp = t_1 elif z <= -5.2e-175: tmp = (-1.0 / t) * ((y * z) - x) elif z <= 3.35e-281: tmp = t_2 elif z <= 2.35e-120: tmp = (x - (y * z)) / t elif z <= 3.2e-92: tmp = t_1 elif (z <= 8.5e-34) or (not (z <= 2.65e-8) and (z <= 23000000000.0)): tmp = t_2 else: tmp = y / (a - (t / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) t_2 = Float64(Float64(-x) / Float64(Float64(a * z) - t)) tmp = 0.0 if (z <= -3e+16) tmp = t_1; elseif (z <= -5.2e-175) tmp = Float64(Float64(-1.0 / t) * Float64(Float64(y * z) - x)); elseif (z <= 3.35e-281) tmp = t_2; elseif (z <= 2.35e-120) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 3.2e-92) tmp = t_1; elseif ((z <= 8.5e-34) || (!(z <= 2.65e-8) && (z <= 23000000000.0))) tmp = t_2; else tmp = Float64(y / Float64(a - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; t_2 = -x / ((a * z) - t); tmp = 0.0; if (z <= -3e+16) tmp = t_1; elseif (z <= -5.2e-175) tmp = (-1.0 / t) * ((y * z) - x); elseif (z <= 3.35e-281) tmp = t_2; elseif (z <= 2.35e-120) tmp = (x - (y * z)) / t; elseif (z <= 3.2e-92) tmp = t_1; elseif ((z <= 8.5e-34) || (~((z <= 2.65e-8)) && (z <= 23000000000.0))) tmp = t_2; else tmp = y / (a - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[(N[(a * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+16], t$95$1, If[LessEqual[z, -5.2e-175], N[(N[(-1.0 / t), $MachinePrecision] * N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.35e-281], t$95$2, If[LessEqual[z, 2.35e-120], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.2e-92], t$95$1, If[Or[LessEqual[z, 8.5e-34], And[N[Not[LessEqual[z, 2.65e-8]], $MachinePrecision], LessEqual[z, 23000000000.0]]], t$95$2, N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
t_2 := \frac{-x}{a \cdot z - t}\\
\mathbf{if}\;z \leq -3 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-175}:\\
\;\;\;\;\frac{-1}{t} \cdot \left(y \cdot z - x\right)\\
\mathbf{elif}\;z \leq 3.35 \cdot 10^{-281}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-120}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-34} \lor \neg \left(z \leq 2.65 \cdot 10^{-8}\right) \land z \leq 23000000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\end{array}
\end{array}
if z < -3e16 or 2.35000000000000008e-120 < z < 3.1999999999999997e-92Initial program 74.4%
sub-neg74.4%
+-commutative74.4%
neg-sub074.4%
associate-+l-74.4%
sub0-neg74.4%
neg-mul-174.4%
sub-neg74.4%
+-commutative74.4%
neg-sub074.4%
associate-+l-74.4%
sub0-neg74.4%
neg-mul-174.4%
times-frac74.4%
metadata-eval74.4%
*-lft-identity74.4%
*-commutative74.4%
Simplified74.4%
div-sub74.4%
associate-/l*84.4%
Applied egg-rr84.4%
Taylor expanded in a around inf 84.3%
if -3e16 < z < -5.2e-175Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
clear-num97.7%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 70.9%
if -5.2e-175 < z < 3.3499999999999998e-281 or 3.1999999999999997e-92 < z < 8.5000000000000001e-34 or 2.6499999999999999e-8 < z < 2.3e10Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 86.6%
neg-mul-186.6%
Simplified86.6%
if 3.3499999999999998e-281 < z < 2.35000000000000008e-120Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in a around 0 84.6%
associate-*r/84.6%
neg-mul-184.6%
neg-sub084.6%
sub-neg84.6%
+-commutative84.6%
associate--r+84.6%
neg-sub084.6%
remove-double-neg84.6%
*-commutative84.6%
Simplified84.6%
if 8.5000000000000001e-34 < z < 2.6499999999999999e-8 or 2.3e10 < z Initial program 75.1%
sub-neg75.1%
+-commutative75.1%
neg-sub075.1%
associate-+l-75.1%
sub0-neg75.1%
neg-mul-175.1%
sub-neg75.1%
+-commutative75.1%
neg-sub075.1%
associate-+l-75.1%
sub0-neg75.1%
neg-mul-175.1%
times-frac75.1%
metadata-eval75.1%
*-lft-identity75.1%
*-commutative75.1%
Simplified75.1%
div-sub75.2%
associate-/l*83.0%
Applied egg-rr83.0%
Taylor expanded in z around 0 96.6%
neg-mul-196.6%
unsub-neg96.6%
Simplified96.6%
Taylor expanded in y around inf 79.7%
Final simplification81.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a (/ t z)))) (t_2 (/ (- x) (- (* a z) t))))
(if (<= y -5.5e+159)
t_1
(if (<= y -7e+148)
(/ (- x (* y z)) t)
(if (<= y -4.5e-33)
t_1
(if (<= y 1.56e-207)
t_2
(if (<= y 1.5e-80)
(- (/ y a) (/ (/ x a) z))
(if (or (<= y 1.3e+155) (not (<= y 1.65e+184))) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double t_2 = -x / ((a * z) - t);
double tmp;
if (y <= -5.5e+159) {
tmp = t_1;
} else if (y <= -7e+148) {
tmp = (x - (y * z)) / t;
} else if (y <= -4.5e-33) {
tmp = t_1;
} else if (y <= 1.56e-207) {
tmp = t_2;
} else if (y <= 1.5e-80) {
tmp = (y / a) - ((x / a) / z);
} else if ((y <= 1.3e+155) || !(y <= 1.65e+184)) {
tmp = 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 = y / (a - (t / z))
t_2 = -x / ((a * z) - t)
if (y <= (-5.5d+159)) then
tmp = t_1
else if (y <= (-7d+148)) then
tmp = (x - (y * z)) / t
else if (y <= (-4.5d-33)) then
tmp = t_1
else if (y <= 1.56d-207) then
tmp = t_2
else if (y <= 1.5d-80) then
tmp = (y / a) - ((x / a) / z)
else if ((y <= 1.3d+155) .or. (.not. (y <= 1.65d+184))) 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 t_1 = y / (a - (t / z));
double t_2 = -x / ((a * z) - t);
double tmp;
if (y <= -5.5e+159) {
tmp = t_1;
} else if (y <= -7e+148) {
tmp = (x - (y * z)) / t;
} else if (y <= -4.5e-33) {
tmp = t_1;
} else if (y <= 1.56e-207) {
tmp = t_2;
} else if (y <= 1.5e-80) {
tmp = (y / a) - ((x / a) / z);
} else if ((y <= 1.3e+155) || !(y <= 1.65e+184)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - (t / z)) t_2 = -x / ((a * z) - t) tmp = 0 if y <= -5.5e+159: tmp = t_1 elif y <= -7e+148: tmp = (x - (y * z)) / t elif y <= -4.5e-33: tmp = t_1 elif y <= 1.56e-207: tmp = t_2 elif y <= 1.5e-80: tmp = (y / a) - ((x / a) / z) elif (y <= 1.3e+155) or not (y <= 1.65e+184): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - Float64(t / z))) t_2 = Float64(Float64(-x) / Float64(Float64(a * z) - t)) tmp = 0.0 if (y <= -5.5e+159) tmp = t_1; elseif (y <= -7e+148) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (y <= -4.5e-33) tmp = t_1; elseif (y <= 1.56e-207) tmp = t_2; elseif (y <= 1.5e-80) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); elseif ((y <= 1.3e+155) || !(y <= 1.65e+184)) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - (t / z)); t_2 = -x / ((a * z) - t); tmp = 0.0; if (y <= -5.5e+159) tmp = t_1; elseif (y <= -7e+148) tmp = (x - (y * z)) / t; elseif (y <= -4.5e-33) tmp = t_1; elseif (y <= 1.56e-207) tmp = t_2; elseif (y <= 1.5e-80) tmp = (y / a) - ((x / a) / z); elseif ((y <= 1.3e+155) || ~((y <= 1.65e+184))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[(N[(a * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+159], t$95$1, If[LessEqual[y, -7e+148], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, -4.5e-33], t$95$1, If[LessEqual[y, 1.56e-207], t$95$2, If[LessEqual[y, 1.5e-80], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.3e+155], N[Not[LessEqual[y, 1.65e+184]], $MachinePrecision]], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
t_2 := \frac{-x}{a \cdot z - t}\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7 \cdot 10^{+148}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.56 \cdot 10^{-207}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+155} \lor \neg \left(y \leq 1.65 \cdot 10^{+184}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -5.4999999999999998e159 or -6.9999999999999998e148 < y < -4.49999999999999991e-33 or 1.50000000000000004e-80 < y < 1.3000000000000001e155 or 1.6499999999999999e184 < y Initial program 81.2%
sub-neg81.2%
+-commutative81.2%
neg-sub081.2%
associate-+l-81.2%
sub0-neg81.2%
neg-mul-181.2%
sub-neg81.2%
+-commutative81.2%
neg-sub081.2%
associate-+l-81.2%
sub0-neg81.2%
neg-mul-181.2%
times-frac81.2%
metadata-eval81.2%
*-lft-identity81.2%
*-commutative81.2%
Simplified81.2%
div-sub80.5%
associate-/l*87.4%
Applied egg-rr87.4%
Taylor expanded in z around 0 96.4%
neg-mul-196.4%
unsub-neg96.4%
Simplified96.4%
Taylor expanded in y around inf 75.7%
if -5.4999999999999998e159 < y < -6.9999999999999998e148Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
neg-sub099.4%
associate-+l-99.4%
sub0-neg99.4%
neg-mul-199.4%
sub-neg99.4%
+-commutative99.4%
neg-sub099.4%
associate-+l-99.4%
sub0-neg99.4%
neg-mul-199.4%
times-frac99.4%
metadata-eval99.4%
*-lft-identity99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in a around 0 99.4%
associate-*r/99.4%
neg-mul-199.4%
neg-sub099.4%
sub-neg99.4%
+-commutative99.4%
associate--r+99.4%
neg-sub099.4%
remove-double-neg99.4%
*-commutative99.4%
Simplified99.4%
if -4.49999999999999991e-33 < y < 1.56000000000000001e-207 or 1.3000000000000001e155 < y < 1.6499999999999999e184Initial program 97.4%
sub-neg97.4%
+-commutative97.4%
neg-sub097.4%
associate-+l-97.4%
sub0-neg97.4%
neg-mul-197.4%
sub-neg97.4%
+-commutative97.4%
neg-sub097.4%
associate-+l-97.4%
sub0-neg97.4%
neg-mul-197.4%
times-frac97.4%
metadata-eval97.4%
*-lft-identity97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in y around 0 86.1%
neg-mul-186.1%
Simplified86.1%
if 1.56000000000000001e-207 < y < 1.50000000000000004e-80Initial program 84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
neg-mul-184.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
neg-mul-184.7%
times-frac84.7%
metadata-eval84.7%
*-lft-identity84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in z around inf 53.5%
mul-1-neg53.5%
+-commutative53.5%
associate--l+53.5%
associate-/r*68.3%
distribute-neg-frac68.3%
mul-1-neg68.3%
associate-/r*71.5%
associate-*r/71.5%
div-sub71.5%
distribute-lft-out--71.5%
associate-*r/71.5%
Simplified84.5%
Taylor expanded in x around inf 84.5%
Final simplification80.5%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -1.16e+16)
(not (or (<= z 1.22e-120) (and (not (<= z 1.8e-88)) (<= z 44.0)))))
(/ (- y (/ x z)) a)
(/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.16e+16) || !((z <= 1.22e-120) || (!(z <= 1.8e-88) && (z <= 44.0)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / 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.16d+16)) .or. (.not. (z <= 1.22d-120) .or. (.not. (z <= 1.8d-88)) .and. (z <= 44.0d0))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (y * z)) / 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.16e+16) || !((z <= 1.22e-120) || (!(z <= 1.8e-88) && (z <= 44.0)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.16e+16) or not ((z <= 1.22e-120) or (not (z <= 1.8e-88) and (z <= 44.0))): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.16e+16) || !((z <= 1.22e-120) || (!(z <= 1.8e-88) && (z <= 44.0)))) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.16e+16) || ~(((z <= 1.22e-120) || (~((z <= 1.8e-88)) && (z <= 44.0))))) tmp = (y - (x / z)) / a; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.16e+16], N[Not[Or[LessEqual[z, 1.22e-120], And[N[Not[LessEqual[z, 1.8e-88]], $MachinePrecision], LessEqual[z, 44.0]]]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.16 \cdot 10^{+16} \lor \neg \left(z \leq 1.22 \cdot 10^{-120} \lor \neg \left(z \leq 1.8 \cdot 10^{-88}\right) \land z \leq 44\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.16e16 or 1.21999999999999996e-120 < z < 1.8e-88 or 44 < z Initial program 74.2%
sub-neg74.2%
+-commutative74.2%
neg-sub074.2%
associate-+l-74.2%
sub0-neg74.2%
neg-mul-174.2%
sub-neg74.2%
+-commutative74.2%
neg-sub074.2%
associate-+l-74.2%
sub0-neg74.2%
neg-mul-174.2%
times-frac74.2%
metadata-eval74.2%
*-lft-identity74.2%
*-commutative74.2%
Simplified74.2%
div-sub74.2%
associate-/l*83.3%
Applied egg-rr83.3%
Taylor expanded in a around inf 81.2%
if -1.16e16 < z < 1.21999999999999996e-120 or 1.8e-88 < z < 44Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in a around 0 74.8%
associate-*r/74.8%
neg-mul-174.8%
neg-sub074.8%
sub-neg74.8%
+-commutative74.8%
associate--r+74.8%
neg-sub074.8%
remove-double-neg74.8%
*-commutative74.8%
Simplified74.8%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e+171) (- (/ y a) (/ (/ x a) z)) (if (<= z 3.8e+211) (/ (- x (* y z)) (- t (* a z))) (/ y (- a (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+171) {
tmp = (y / a) - ((x / a) / z);
} else if (z <= 3.8e+211) {
tmp = (x - (y * z)) / (t - (a * z));
} else {
tmp = y / (a - (t / z));
}
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.1d+171)) then
tmp = (y / a) - ((x / a) / z)
else if (z <= 3.8d+211) then
tmp = (x - (y * z)) / (t - (a * z))
else
tmp = y / (a - (t / z))
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.1e+171) {
tmp = (y / a) - ((x / a) / z);
} else if (z <= 3.8e+211) {
tmp = (x - (y * z)) / (t - (a * z));
} else {
tmp = y / (a - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+171: tmp = (y / a) - ((x / a) / z) elif z <= 3.8e+211: tmp = (x - (y * z)) / (t - (a * z)) else: tmp = y / (a - (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+171) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / z)); elseif (z <= 3.8e+211) tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))); else tmp = Float64(y / Float64(a - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+171) tmp = (y / a) - ((x / a) / z); elseif (z <= 3.8e+211) tmp = (x - (y * z)) / (t - (a * z)); else tmp = y / (a - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+171], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+211], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+171}:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+211}:\\
\;\;\;\;\frac{x - y \cdot z}{t - a \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\end{array}
\end{array}
if z < -1.1e171Initial program 68.6%
sub-neg68.6%
+-commutative68.6%
neg-sub068.6%
associate-+l-68.6%
sub0-neg68.6%
neg-mul-168.6%
sub-neg68.6%
+-commutative68.6%
neg-sub068.6%
associate-+l-68.6%
sub0-neg68.6%
neg-mul-168.6%
times-frac68.6%
metadata-eval68.6%
*-lft-identity68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in z around inf 65.3%
mul-1-neg65.3%
+-commutative65.3%
associate--l+65.3%
associate-/r*73.6%
distribute-neg-frac73.6%
mul-1-neg73.6%
associate-/r*73.6%
associate-*r/73.6%
div-sub73.6%
distribute-lft-out--73.6%
associate-*r/73.6%
Simplified82.5%
Taylor expanded in x around inf 91.4%
if -1.1e171 < z < 3.80000000000000016e211Initial program 93.8%
if 3.80000000000000016e211 < z Initial program 46.1%
sub-neg46.1%
+-commutative46.1%
neg-sub046.1%
associate-+l-46.1%
sub0-neg46.1%
neg-mul-146.1%
sub-neg46.1%
+-commutative46.1%
neg-sub046.1%
associate-+l-46.1%
sub0-neg46.1%
neg-mul-146.1%
times-frac46.1%
metadata-eval46.1%
*-lft-identity46.1%
*-commutative46.1%
Simplified46.1%
div-sub46.1%
associate-/l*62.6%
Applied egg-rr62.6%
Taylor expanded in z around 0 94.5%
neg-mul-194.5%
unsub-neg94.5%
Simplified94.5%
Taylor expanded in y around inf 89.0%
Final simplification93.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.4e-131) (not (<= z 6e-35))) (/ y (- a (/ t z))) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.4e-131) || !(z <= 6e-35)) {
tmp = y / (a - (t / z));
} 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 <= (-8.4d-131)) .or. (.not. (z <= 6d-35))) then
tmp = y / (a - (t / z))
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 <= -8.4e-131) || !(z <= 6e-35)) {
tmp = y / (a - (t / z));
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.4e-131) or not (z <= 6e-35): tmp = y / (a - (t / z)) else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.4e-131) || !(z <= 6e-35)) tmp = Float64(y / Float64(a - Float64(t / z))); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.4e-131) || ~((z <= 6e-35))) tmp = y / (a - (t / z)); else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.4e-131], N[Not[LessEqual[z, 6e-35]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.4 \cdot 10^{-131} \lor \neg \left(z \leq 6 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -8.39999999999999988e-131 or 5.99999999999999978e-35 < z Initial program 79.6%
sub-neg79.6%
+-commutative79.6%
neg-sub079.6%
associate-+l-79.6%
sub0-neg79.6%
neg-mul-179.6%
sub-neg79.6%
+-commutative79.6%
neg-sub079.6%
associate-+l-79.6%
sub0-neg79.6%
neg-mul-179.6%
times-frac79.6%
metadata-eval79.6%
*-lft-identity79.6%
*-commutative79.6%
Simplified79.6%
div-sub79.6%
associate-/l*86.8%
Applied egg-rr86.8%
Taylor expanded in z around 0 95.1%
neg-mul-195.1%
unsub-neg95.1%
Simplified95.1%
Taylor expanded in y around inf 72.8%
if -8.39999999999999988e-131 < z < 5.99999999999999978e-35Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 64.9%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.05e-100) (not (<= z 1.35e-33))) (/ y (- a (/ t z))) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.05e-100) || !(z <= 1.35e-33)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (y * z)) / 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.05d-100)) .or. (.not. (z <= 1.35d-33))) then
tmp = y / (a - (t / z))
else
tmp = (x - (y * z)) / 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.05e-100) || !(z <= 1.35e-33)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.05e-100) or not (z <= 1.35e-33): tmp = y / (a - (t / z)) else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.05e-100) || !(z <= 1.35e-33)) tmp = Float64(y / Float64(a - Float64(t / z))); else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.05e-100) || ~((z <= 1.35e-33))) tmp = y / (a - (t / z)); else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.05e-100], N[Not[LessEqual[z, 1.35e-33]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-100} \lor \neg \left(z \leq 1.35 \cdot 10^{-33}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -2.0499999999999999e-100 or 1.35e-33 < z Initial program 78.7%
sub-neg78.7%
+-commutative78.7%
neg-sub078.7%
associate-+l-78.7%
sub0-neg78.7%
neg-mul-178.7%
sub-neg78.7%
+-commutative78.7%
neg-sub078.7%
associate-+l-78.7%
sub0-neg78.7%
neg-mul-178.7%
times-frac78.7%
metadata-eval78.7%
*-lft-identity78.7%
*-commutative78.7%
Simplified78.7%
div-sub78.7%
associate-/l*86.2%
Applied egg-rr86.2%
Taylor expanded in z around 0 94.9%
neg-mul-194.9%
unsub-neg94.9%
Simplified94.9%
Taylor expanded in y around inf 73.4%
if -2.0499999999999999e-100 < z < 1.35e-33Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in a around 0 76.3%
associate-*r/76.3%
neg-mul-176.3%
neg-sub076.3%
sub-neg76.3%
+-commutative76.3%
associate--r+76.3%
neg-sub076.3%
remove-double-neg76.3%
*-commutative76.3%
Simplified76.3%
Final simplification74.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.9e-62) (/ y a) (if (<= z 4.5e-31) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e-62) {
tmp = y / a;
} else if (z <= 4.5e-31) {
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.9d-62)) then
tmp = y / a
else if (z <= 4.5d-31) 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.9e-62) {
tmp = y / a;
} else if (z <= 4.5e-31) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.9e-62: tmp = y / a elif z <= 4.5e-31: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e-62) tmp = Float64(y / a); elseif (z <= 4.5e-31) 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.9e-62) tmp = y / a; elseif (z <= 4.5e-31) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e-62], N[(y / a), $MachinePrecision], If[LessEqual[z, 4.5e-31], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-62}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-31}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.89999999999999986e-62 or 4.5000000000000004e-31 < z Initial program 76.9%
sub-neg76.9%
+-commutative76.9%
neg-sub076.9%
associate-+l-76.9%
sub0-neg76.9%
neg-mul-176.9%
sub-neg76.9%
+-commutative76.9%
neg-sub076.9%
associate-+l-76.9%
sub0-neg76.9%
neg-mul-176.9%
times-frac76.9%
metadata-eval76.9%
*-lft-identity76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in z around inf 55.2%
if -2.89999999999999986e-62 < z < 4.5000000000000004e-31Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 60.1%
Final simplification57.4%
(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 87.1%
sub-neg87.1%
+-commutative87.1%
neg-sub087.1%
associate-+l-87.1%
sub0-neg87.1%
neg-mul-187.1%
sub-neg87.1%
+-commutative87.1%
neg-sub087.1%
associate-+l-87.1%
sub0-neg87.1%
neg-mul-187.1%
times-frac87.1%
metadata-eval87.1%
*-lft-identity87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in z around 0 32.9%
Final simplification32.9%
(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 2023189
(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))))