
(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 14 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
(let* ((t_1 (- t (* z a))))
(if (or (<= z -2e-44) (not (<= z 90000000.0)))
(- (/ x t_1) (/ y (- (/ t z) a)))
(/ (- x (* z y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double tmp;
if ((z <= -2e-44) || !(z <= 90000000.0)) {
tmp = (x / t_1) - (y / ((t / z) - a));
} else {
tmp = (x - (z * y)) / t_1;
}
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 = t - (z * a)
if ((z <= (-2d-44)) .or. (.not. (z <= 90000000.0d0))) then
tmp = (x / t_1) - (y / ((t / z) - a))
else
tmp = (x - (z * y)) / t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double tmp;
if ((z <= -2e-44) || !(z <= 90000000.0)) {
tmp = (x / t_1) - (y / ((t / z) - a));
} else {
tmp = (x - (z * y)) / t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) tmp = 0 if (z <= -2e-44) or not (z <= 90000000.0): tmp = (x / t_1) - (y / ((t / z) - a)) else: tmp = (x - (z * y)) / t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) tmp = 0.0 if ((z <= -2e-44) || !(z <= 90000000.0)) tmp = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))); else tmp = Float64(Float64(x - Float64(z * y)) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); tmp = 0.0; if ((z <= -2e-44) || ~((z <= 90000000.0))) tmp = (x / t_1) - (y / ((t / z) - a)); else tmp = (x - (z * y)) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -2e-44], N[Not[LessEqual[z, 90000000.0]], $MachinePrecision]], N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
\mathbf{if}\;z \leq -2 \cdot 10^{-44} \lor \neg \left(z \leq 90000000\right):\\
\;\;\;\;\frac{x}{t_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t_1}\\
\end{array}
\end{array}
if z < -1.99999999999999991e-44 or 9e7 < z Initial program 69.1%
*-commutative69.1%
Simplified69.1%
clear-num68.5%
associate-/r/69.1%
sub-neg69.1%
+-commutative69.1%
*-commutative69.1%
distribute-rgt-neg-in69.1%
fma-def69.1%
Applied egg-rr69.1%
Taylor expanded in x around 0 69.1%
+-commutative69.1%
mul-1-neg69.1%
unsub-neg69.1%
mul-1-neg69.1%
sub-neg69.1%
*-commutative69.1%
associate-/l*81.7%
mul-1-neg81.7%
sub-neg81.7%
*-commutative81.7%
div-sub81.7%
*-commutative81.7%
associate-*l/86.3%
associate-/r/95.8%
*-inverses95.8%
/-rgt-identity95.8%
Simplified95.8%
if -1.99999999999999991e-44 < z < 9e7Initial program 99.9%
Final simplification97.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* z y)) t_1)))
(if (<= t_2 (- INFINITY))
(* z (/ (- y) t_1))
(if (or (<= t_2 -1e-305) (and (not (<= t_2 0.0)) (<= t_2 1e+291)))
t_2
(- (/ (/ (- x) a) z) (/ y (- (/ t z) a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x - (z * y)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = z * (-y / t_1);
} else if ((t_2 <= -1e-305) || (!(t_2 <= 0.0) && (t_2 <= 1e+291))) {
tmp = t_2;
} else {
tmp = ((-x / a) / z) - (y / ((t / z) - a));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x - (z * y)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = z * (-y / t_1);
} else if ((t_2 <= -1e-305) || (!(t_2 <= 0.0) && (t_2 <= 1e+291))) {
tmp = t_2;
} else {
tmp = ((-x / a) / z) - (y / ((t / z) - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (x - (z * y)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = z * (-y / t_1) elif (t_2 <= -1e-305) or (not (t_2 <= 0.0) and (t_2 <= 1e+291)): tmp = t_2 else: tmp = ((-x / a) / z) - (y / ((t / z) - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(x - Float64(z * y)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(z * Float64(Float64(-y) / t_1)); elseif ((t_2 <= -1e-305) || (!(t_2 <= 0.0) && (t_2 <= 1e+291))) tmp = t_2; else tmp = Float64(Float64(Float64(Float64(-x) / a) / z) - Float64(y / Float64(Float64(t / z) - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (x - (z * y)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = z * (-y / t_1); elseif ((t_2 <= -1e-305) || (~((t_2 <= 0.0)) && (t_2 <= 1e+291))) tmp = t_2; else tmp = ((-x / a) / z) - (y / ((t / z) - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(z * N[((-y) / t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$2, -1e-305], And[N[Not[LessEqual[t$95$2, 0.0]], $MachinePrecision], LessEqual[t$95$2, 1e+291]]], t$95$2, N[(N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x - z \cdot y}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;z \cdot \frac{-y}{t_1}\\
\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-305} \lor \neg \left(t_2 \leq 0\right) \land t_2 \leq 10^{+291}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z} - \frac{y}{\frac{t}{z} - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 48.7%
*-commutative48.7%
Simplified48.7%
Taylor expanded in x around 0 21.9%
mul-1-neg21.9%
associate-/l*73.0%
associate-/r/77.1%
cancel-sign-sub-inv77.1%
+-commutative77.1%
distribute-lft-neg-in77.1%
distribute-rgt-neg-in77.1%
fma-udef77.1%
distribute-rgt-neg-in77.1%
fma-udef77.1%
distribute-rgt-neg-in77.1%
distribute-lft-neg-in77.1%
+-commutative77.1%
cancel-sign-sub-inv77.1%
*-commutative77.1%
Simplified77.1%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -9.99999999999999996e-306 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 9.9999999999999996e290Initial program 99.7%
if -9.99999999999999996e-306 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0 or 9.9999999999999996e290 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 46.0%
*-commutative46.0%
Simplified46.0%
clear-num45.0%
associate-/r/46.0%
sub-neg46.0%
+-commutative46.0%
*-commutative46.0%
distribute-rgt-neg-in46.0%
fma-def46.0%
Applied egg-rr46.0%
Taylor expanded in x around 0 44.4%
+-commutative44.4%
mul-1-neg44.4%
unsub-neg44.4%
mul-1-neg44.4%
sub-neg44.4%
*-commutative44.4%
associate-/l*55.8%
mul-1-neg55.8%
sub-neg55.8%
*-commutative55.8%
div-sub55.8%
*-commutative55.8%
associate-*l/85.6%
associate-/r/88.9%
*-inverses88.9%
/-rgt-identity88.9%
Simplified88.9%
Taylor expanded in t around 0 77.9%
mul-1-neg34.4%
associate-/r*46.5%
Simplified88.9%
Final simplification95.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* z y)) t_1)))
(if (<= t_2 (- INFINITY))
(* z (/ (- y) t_1))
(if (<= t_2 -1e-305)
t_2
(if (<= t_2 0.0)
(/ (- y) (- (/ t z) a))
(if (<= t_2 1e+291) t_2 (/ (* y (- 1.0 (/ x (* z y)))) a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x - (z * y)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = z * (-y / t_1);
} else if (t_2 <= -1e-305) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = -y / ((t / z) - a);
} else if (t_2 <= 1e+291) {
tmp = t_2;
} else {
tmp = (y * (1.0 - (x / (z * y)))) / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x - (z * y)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = z * (-y / t_1);
} else if (t_2 <= -1e-305) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = -y / ((t / z) - a);
} else if (t_2 <= 1e+291) {
tmp = t_2;
} else {
tmp = (y * (1.0 - (x / (z * y)))) / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (x - (z * y)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = z * (-y / t_1) elif t_2 <= -1e-305: tmp = t_2 elif t_2 <= 0.0: tmp = -y / ((t / z) - a) elif t_2 <= 1e+291: tmp = t_2 else: tmp = (y * (1.0 - (x / (z * y)))) / a return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(x - Float64(z * y)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(z * Float64(Float64(-y) / t_1)); elseif (t_2 <= -1e-305) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(-y) / Float64(Float64(t / z) - a)); elseif (t_2 <= 1e+291) tmp = t_2; else tmp = Float64(Float64(y * Float64(1.0 - Float64(x / Float64(z * y)))) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (x - (z * y)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = z * (-y / t_1); elseif (t_2 <= -1e-305) tmp = t_2; elseif (t_2 <= 0.0) tmp = -y / ((t / z) - a); elseif (t_2 <= 1e+291) tmp = t_2; else tmp = (y * (1.0 - (x / (z * y)))) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(z * N[((-y) / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-305], t$95$2, If[LessEqual[t$95$2, 0.0], N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+291], t$95$2, N[(N[(y * N[(1.0 - N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x - z \cdot y}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;z \cdot \frac{-y}{t_1}\\
\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-305}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{-y}{\frac{t}{z} - a}\\
\mathbf{elif}\;t_2 \leq 10^{+291}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(1 - \frac{x}{z \cdot y}\right)}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 48.7%
*-commutative48.7%
Simplified48.7%
Taylor expanded in x around 0 21.9%
mul-1-neg21.9%
associate-/l*73.0%
associate-/r/77.1%
cancel-sign-sub-inv77.1%
+-commutative77.1%
distribute-lft-neg-in77.1%
distribute-rgt-neg-in77.1%
fma-udef77.1%
distribute-rgt-neg-in77.1%
fma-udef77.1%
distribute-rgt-neg-in77.1%
distribute-lft-neg-in77.1%
+-commutative77.1%
cancel-sign-sub-inv77.1%
*-commutative77.1%
Simplified77.1%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -9.99999999999999996e-306 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 9.9999999999999996e290Initial program 99.7%
if -9.99999999999999996e-306 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 63.2%
*-commutative63.2%
Simplified63.2%
clear-num61.4%
associate-/r/63.2%
sub-neg63.2%
+-commutative63.2%
*-commutative63.2%
distribute-rgt-neg-in63.2%
fma-def63.2%
Applied egg-rr63.2%
Taylor expanded in x around 0 63.2%
mul-1-neg63.2%
associate-/l*63.2%
distribute-neg-frac63.2%
mul-1-neg63.2%
sub-neg63.2%
*-commutative63.2%
div-sub63.2%
*-commutative63.2%
associate-*l/80.3%
associate-/r/83.2%
*-inverses83.2%
/-rgt-identity83.2%
Simplified83.2%
if 9.9999999999999996e290 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 23.7%
*-commutative23.7%
Simplified23.7%
Taylor expanded in t around 0 23.6%
associate-*r*23.6%
neg-mul-123.6%
*-commutative23.6%
Simplified23.6%
Taylor expanded in x around 0 81.9%
+-commutative81.9%
mul-1-neg81.9%
unsub-neg81.9%
*-commutative81.9%
Simplified81.9%
clear-num81.7%
associate-/r*81.7%
frac-sub64.1%
*-un-lft-identity64.1%
Applied egg-rr64.1%
Taylor expanded in a around 0 89.3%
Final simplification94.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.1e+152)
(/ y a)
(if (<= z -4800000.0)
(/ (/ (- x) z) a)
(if (<= z -2.9e-69)
(/ y a)
(if (<= z 5.2e-84)
(/ x t)
(if (<= z 1.05e+35)
(/ (/ (- x) a) z)
(if (<= z 5.3e+42)
(/ x t)
(if (<= z 6.2e+92)
(/ y a)
(if (<= z 1.75e+124)
(/ (- x) (* z a))
(if (<= z 3.6e+222) (- (/ y (/ t z))) (/ y a)))))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+152) {
tmp = y / a;
} else if (z <= -4800000.0) {
tmp = (-x / z) / a;
} else if (z <= -2.9e-69) {
tmp = y / a;
} else if (z <= 5.2e-84) {
tmp = x / t;
} else if (z <= 1.05e+35) {
tmp = (-x / a) / z;
} else if (z <= 5.3e+42) {
tmp = x / t;
} else if (z <= 6.2e+92) {
tmp = y / a;
} else if (z <= 1.75e+124) {
tmp = -x / (z * a);
} else if (z <= 3.6e+222) {
tmp = -(y / (t / z));
} 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 <= (-1.1d+152)) then
tmp = y / a
else if (z <= (-4800000.0d0)) then
tmp = (-x / z) / a
else if (z <= (-2.9d-69)) then
tmp = y / a
else if (z <= 5.2d-84) then
tmp = x / t
else if (z <= 1.05d+35) then
tmp = (-x / a) / z
else if (z <= 5.3d+42) then
tmp = x / t
else if (z <= 6.2d+92) then
tmp = y / a
else if (z <= 1.75d+124) then
tmp = -x / (z * a)
else if (z <= 3.6d+222) then
tmp = -(y / (t / z))
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 <= -1.1e+152) {
tmp = y / a;
} else if (z <= -4800000.0) {
tmp = (-x / z) / a;
} else if (z <= -2.9e-69) {
tmp = y / a;
} else if (z <= 5.2e-84) {
tmp = x / t;
} else if (z <= 1.05e+35) {
tmp = (-x / a) / z;
} else if (z <= 5.3e+42) {
tmp = x / t;
} else if (z <= 6.2e+92) {
tmp = y / a;
} else if (z <= 1.75e+124) {
tmp = -x / (z * a);
} else if (z <= 3.6e+222) {
tmp = -(y / (t / z));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+152: tmp = y / a elif z <= -4800000.0: tmp = (-x / z) / a elif z <= -2.9e-69: tmp = y / a elif z <= 5.2e-84: tmp = x / t elif z <= 1.05e+35: tmp = (-x / a) / z elif z <= 5.3e+42: tmp = x / t elif z <= 6.2e+92: tmp = y / a elif z <= 1.75e+124: tmp = -x / (z * a) elif z <= 3.6e+222: tmp = -(y / (t / z)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+152) tmp = Float64(y / a); elseif (z <= -4800000.0) tmp = Float64(Float64(Float64(-x) / z) / a); elseif (z <= -2.9e-69) tmp = Float64(y / a); elseif (z <= 5.2e-84) tmp = Float64(x / t); elseif (z <= 1.05e+35) tmp = Float64(Float64(Float64(-x) / a) / z); elseif (z <= 5.3e+42) tmp = Float64(x / t); elseif (z <= 6.2e+92) tmp = Float64(y / a); elseif (z <= 1.75e+124) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 3.6e+222) tmp = Float64(-Float64(y / Float64(t / z))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+152) tmp = y / a; elseif (z <= -4800000.0) tmp = (-x / z) / a; elseif (z <= -2.9e-69) tmp = y / a; elseif (z <= 5.2e-84) tmp = x / t; elseif (z <= 1.05e+35) tmp = (-x / a) / z; elseif (z <= 5.3e+42) tmp = x / t; elseif (z <= 6.2e+92) tmp = y / a; elseif (z <= 1.75e+124) tmp = -x / (z * a); elseif (z <= 3.6e+222) tmp = -(y / (t / z)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+152], N[(y / a), $MachinePrecision], If[LessEqual[z, -4800000.0], N[(N[((-x) / z), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, -2.9e-69], N[(y / a), $MachinePrecision], If[LessEqual[z, 5.2e-84], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.05e+35], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 5.3e+42], N[(x / t), $MachinePrecision], If[LessEqual[z, 6.2e+92], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.75e+124], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+222], (-N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), N[(y / a), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+152}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -4800000:\\
\;\;\;\;\frac{\frac{-x}{z}}{a}\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-69}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+35}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+42}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+124}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+222}:\\
\;\;\;\;-\frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.0999999999999999e152 or -4.8e6 < z < -2.8999999999999998e-69 or 5.30000000000000028e42 < z < 6.2000000000000004e92 or 3.6000000000000002e222 < z Initial program 58.6%
*-commutative58.6%
Simplified58.6%
Taylor expanded in z around inf 69.9%
if -1.0999999999999999e152 < z < -4.8e6Initial program 89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in x around inf 63.8%
*-commutative63.8%
Simplified63.8%
Taylor expanded in t around 0 48.8%
associate-*r/48.8%
neg-mul-148.8%
*-commutative48.8%
Simplified48.8%
Taylor expanded in x around 0 48.8%
mul-1-neg48.8%
associate-/l/54.2%
distribute-neg-frac54.2%
Simplified54.2%
if -2.8999999999999998e-69 < z < 5.2e-84 or 1.0499999999999999e35 < z < 5.30000000000000028e42Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 66.2%
if 5.2e-84 < z < 1.0499999999999999e35Initial program 91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in x around inf 65.3%
*-commutative65.3%
Simplified65.3%
Taylor expanded in t around 0 43.4%
mul-1-neg43.4%
associate-/r*51.4%
Simplified51.4%
if 6.2000000000000004e92 < z < 1.7500000000000001e124Initial program 91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in x around inf 74.1%
*-commutative74.1%
Simplified74.1%
Taylor expanded in t around 0 47.8%
associate-*r/47.8%
neg-mul-147.8%
*-commutative47.8%
Simplified47.8%
if 1.7500000000000001e124 < z < 3.6000000000000002e222Initial program 66.3%
*-commutative66.3%
Simplified66.3%
Taylor expanded in x around 0 33.7%
mul-1-neg33.7%
associate-/l*54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in t around inf 49.9%
Final simplification62.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y) (- (/ t z) a)))
(t_2 (/ (- y (/ x z)) a))
(t_3 (/ (- x (* z y)) t)))
(if (<= z -3.2e+81)
t_2
(if (<= z -4e+52)
t_1
(if (<= z -1.1e-10)
t_2
(if (<= z 2.85e-74)
t_3
(if (<= z 1.15e-34)
(/ x (- t (* z a)))
(if (<= z 38000000.0) t_3 (if (<= z 3.5e+62) t_2 t_1)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -y / ((t / z) - a);
double t_2 = (y - (x / z)) / a;
double t_3 = (x - (z * y)) / t;
double tmp;
if (z <= -3.2e+81) {
tmp = t_2;
} else if (z <= -4e+52) {
tmp = t_1;
} else if (z <= -1.1e-10) {
tmp = t_2;
} else if (z <= 2.85e-74) {
tmp = t_3;
} else if (z <= 1.15e-34) {
tmp = x / (t - (z * a));
} else if (z <= 38000000.0) {
tmp = t_3;
} else if (z <= 3.5e+62) {
tmp = t_2;
} else {
tmp = t_1;
}
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 = -y / ((t / z) - a)
t_2 = (y - (x / z)) / a
t_3 = (x - (z * y)) / t
if (z <= (-3.2d+81)) then
tmp = t_2
else if (z <= (-4d+52)) then
tmp = t_1
else if (z <= (-1.1d-10)) then
tmp = t_2
else if (z <= 2.85d-74) then
tmp = t_3
else if (z <= 1.15d-34) then
tmp = x / (t - (z * a))
else if (z <= 38000000.0d0) then
tmp = t_3
else if (z <= 3.5d+62) then
tmp = t_2
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 t_1 = -y / ((t / z) - a);
double t_2 = (y - (x / z)) / a;
double t_3 = (x - (z * y)) / t;
double tmp;
if (z <= -3.2e+81) {
tmp = t_2;
} else if (z <= -4e+52) {
tmp = t_1;
} else if (z <= -1.1e-10) {
tmp = t_2;
} else if (z <= 2.85e-74) {
tmp = t_3;
} else if (z <= 1.15e-34) {
tmp = x / (t - (z * a));
} else if (z <= 38000000.0) {
tmp = t_3;
} else if (z <= 3.5e+62) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -y / ((t / z) - a) t_2 = (y - (x / z)) / a t_3 = (x - (z * y)) / t tmp = 0 if z <= -3.2e+81: tmp = t_2 elif z <= -4e+52: tmp = t_1 elif z <= -1.1e-10: tmp = t_2 elif z <= 2.85e-74: tmp = t_3 elif z <= 1.15e-34: tmp = x / (t - (z * a)) elif z <= 38000000.0: tmp = t_3 elif z <= 3.5e+62: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-y) / Float64(Float64(t / z) - a)) t_2 = Float64(Float64(y - Float64(x / z)) / a) t_3 = Float64(Float64(x - Float64(z * y)) / t) tmp = 0.0 if (z <= -3.2e+81) tmp = t_2; elseif (z <= -4e+52) tmp = t_1; elseif (z <= -1.1e-10) tmp = t_2; elseif (z <= 2.85e-74) tmp = t_3; elseif (z <= 1.15e-34) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 38000000.0) tmp = t_3; elseif (z <= 3.5e+62) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -y / ((t / z) - a); t_2 = (y - (x / z)) / a; t_3 = (x - (z * y)) / t; tmp = 0.0; if (z <= -3.2e+81) tmp = t_2; elseif (z <= -4e+52) tmp = t_1; elseif (z <= -1.1e-10) tmp = t_2; elseif (z <= 2.85e-74) tmp = t_3; elseif (z <= 1.15e-34) tmp = x / (t - (z * a)); elseif (z <= 38000000.0) tmp = t_3; elseif (z <= 3.5e+62) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -3.2e+81], t$95$2, If[LessEqual[z, -4e+52], t$95$1, If[LessEqual[z, -1.1e-10], t$95$2, If[LessEqual[z, 2.85e-74], t$95$3, If[LessEqual[z, 1.15e-34], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 38000000.0], t$95$3, If[LessEqual[z, 3.5e+62], t$95$2, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-y}{\frac{t}{z} - a}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
t_3 := \frac{x - z \cdot y}{t}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+81}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-10}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-74}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-34}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 38000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+62}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.2e81 or -4e52 < z < -1.09999999999999995e-10 or 3.8e7 < z < 3.49999999999999984e62Initial program 76.1%
*-commutative76.1%
Simplified76.1%
clear-num76.0%
associate-/r/76.1%
sub-neg76.1%
+-commutative76.1%
*-commutative76.1%
distribute-rgt-neg-in76.1%
fma-def76.1%
Applied egg-rr76.1%
Taylor expanded in x around 0 76.1%
+-commutative76.1%
mul-1-neg76.1%
unsub-neg76.1%
mul-1-neg76.1%
sub-neg76.1%
*-commutative76.1%
associate-/l*80.9%
mul-1-neg80.9%
sub-neg80.9%
*-commutative80.9%
div-sub80.9%
*-commutative80.9%
associate-*l/81.4%
associate-/r/92.2%
*-inverses92.2%
/-rgt-identity92.2%
Simplified92.2%
Taylor expanded in t around 0 79.6%
sub-neg79.6%
mul-1-neg79.6%
remove-double-neg79.6%
+-commutative79.6%
mul-1-neg79.6%
associate-/l/87.1%
sub-neg87.1%
div-sub87.1%
Simplified87.1%
if -3.2e81 < z < -4e52 or 3.49999999999999984e62 < z Initial program 61.2%
*-commutative61.2%
Simplified61.2%
clear-num60.2%
associate-/r/61.1%
sub-neg61.1%
+-commutative61.1%
*-commutative61.1%
distribute-rgt-neg-in61.1%
fma-def61.1%
Applied egg-rr61.1%
Taylor expanded in x around 0 36.3%
mul-1-neg36.3%
associate-/l*56.4%
distribute-neg-frac56.4%
mul-1-neg56.4%
sub-neg56.4%
*-commutative56.4%
div-sub56.4%
*-commutative56.4%
associate-*l/69.7%
associate-/r/73.7%
*-inverses73.7%
/-rgt-identity73.7%
Simplified73.7%
if -1.09999999999999995e-10 < z < 2.85000000000000012e-74 or 1.15000000000000006e-34 < z < 3.8e7Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 83.1%
if 2.85000000000000012e-74 < z < 1.15000000000000006e-34Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 88.6%
*-commutative88.6%
Simplified88.6%
Final simplification81.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y) (- (/ t z) a))) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -1.15e+82)
t_2
(if (<= z -2.3e+52)
t_1
(if (<= z -4.4e-12)
t_2
(if (<= z 1.2e-73)
(- (/ x t) (/ (* z y) t))
(if (<= z 1.7e-33)
(/ x (- t (* z a)))
(if (<= z 320000000.0)
(/ (- x (* z y)) t)
(if (<= z 2.9e+62) t_2 t_1)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -y / ((t / z) - a);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.15e+82) {
tmp = t_2;
} else if (z <= -2.3e+52) {
tmp = t_1;
} else if (z <= -4.4e-12) {
tmp = t_2;
} else if (z <= 1.2e-73) {
tmp = (x / t) - ((z * y) / t);
} else if (z <= 1.7e-33) {
tmp = x / (t - (z * a));
} else if (z <= 320000000.0) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.9e+62) {
tmp = t_2;
} else {
tmp = t_1;
}
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 / ((t / z) - a)
t_2 = (y - (x / z)) / a
if (z <= (-1.15d+82)) then
tmp = t_2
else if (z <= (-2.3d+52)) then
tmp = t_1
else if (z <= (-4.4d-12)) then
tmp = t_2
else if (z <= 1.2d-73) then
tmp = (x / t) - ((z * y) / t)
else if (z <= 1.7d-33) then
tmp = x / (t - (z * a))
else if (z <= 320000000.0d0) then
tmp = (x - (z * y)) / t
else if (z <= 2.9d+62) then
tmp = t_2
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 t_1 = -y / ((t / z) - a);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.15e+82) {
tmp = t_2;
} else if (z <= -2.3e+52) {
tmp = t_1;
} else if (z <= -4.4e-12) {
tmp = t_2;
} else if (z <= 1.2e-73) {
tmp = (x / t) - ((z * y) / t);
} else if (z <= 1.7e-33) {
tmp = x / (t - (z * a));
} else if (z <= 320000000.0) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.9e+62) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -y / ((t / z) - a) t_2 = (y - (x / z)) / a tmp = 0 if z <= -1.15e+82: tmp = t_2 elif z <= -2.3e+52: tmp = t_1 elif z <= -4.4e-12: tmp = t_2 elif z <= 1.2e-73: tmp = (x / t) - ((z * y) / t) elif z <= 1.7e-33: tmp = x / (t - (z * a)) elif z <= 320000000.0: tmp = (x - (z * y)) / t elif z <= 2.9e+62: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-y) / Float64(Float64(t / z) - a)) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -1.15e+82) tmp = t_2; elseif (z <= -2.3e+52) tmp = t_1; elseif (z <= -4.4e-12) tmp = t_2; elseif (z <= 1.2e-73) tmp = Float64(Float64(x / t) - Float64(Float64(z * y) / t)); elseif (z <= 1.7e-33) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 320000000.0) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 2.9e+62) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -y / ((t / z) - a); t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -1.15e+82) tmp = t_2; elseif (z <= -2.3e+52) tmp = t_1; elseif (z <= -4.4e-12) tmp = t_2; elseif (z <= 1.2e-73) tmp = (x / t) - ((z * y) / t); elseif (z <= 1.7e-33) tmp = x / (t - (z * a)); elseif (z <= 320000000.0) tmp = (x - (z * y)) / t; elseif (z <= 2.9e+62) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1.15e+82], t$95$2, If[LessEqual[z, -2.3e+52], t$95$1, If[LessEqual[z, -4.4e-12], t$95$2, If[LessEqual[z, 1.2e-73], N[(N[(x / t), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-33], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 320000000.0], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.9e+62], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-y}{\frac{t}{z} - a}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+82}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-12}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-73}:\\
\;\;\;\;\frac{x}{t} - \frac{z \cdot y}{t}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 320000000:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+62}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.14999999999999994e82 or -2.3e52 < z < -4.39999999999999983e-12 or 3.2e8 < z < 2.89999999999999984e62Initial program 76.1%
*-commutative76.1%
Simplified76.1%
clear-num76.0%
associate-/r/76.1%
sub-neg76.1%
+-commutative76.1%
*-commutative76.1%
distribute-rgt-neg-in76.1%
fma-def76.1%
Applied egg-rr76.1%
Taylor expanded in x around 0 76.1%
+-commutative76.1%
mul-1-neg76.1%
unsub-neg76.1%
mul-1-neg76.1%
sub-neg76.1%
*-commutative76.1%
associate-/l*80.9%
mul-1-neg80.9%
sub-neg80.9%
*-commutative80.9%
div-sub80.9%
*-commutative80.9%
associate-*l/81.4%
associate-/r/92.2%
*-inverses92.2%
/-rgt-identity92.2%
Simplified92.2%
Taylor expanded in t around 0 79.6%
sub-neg79.6%
mul-1-neg79.6%
remove-double-neg79.6%
+-commutative79.6%
mul-1-neg79.6%
associate-/l/87.1%
sub-neg87.1%
div-sub87.1%
Simplified87.1%
if -1.14999999999999994e82 < z < -2.3e52 or 2.89999999999999984e62 < z Initial program 61.2%
*-commutative61.2%
Simplified61.2%
clear-num60.2%
associate-/r/61.1%
sub-neg61.1%
+-commutative61.1%
*-commutative61.1%
distribute-rgt-neg-in61.1%
fma-def61.1%
Applied egg-rr61.1%
Taylor expanded in x around 0 36.3%
mul-1-neg36.3%
associate-/l*56.4%
distribute-neg-frac56.4%
mul-1-neg56.4%
sub-neg56.4%
*-commutative56.4%
div-sub56.4%
*-commutative56.4%
associate-*l/69.7%
associate-/r/73.7%
*-inverses73.7%
/-rgt-identity73.7%
Simplified73.7%
if -4.39999999999999983e-12 < z < 1.20000000000000003e-73Initial program 99.9%
*-commutative99.9%
Simplified99.9%
clear-num98.9%
associate-/r/99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
mul-1-neg99.9%
sub-neg99.9%
*-commutative99.9%
associate-/l*92.7%
mul-1-neg92.7%
sub-neg92.7%
*-commutative92.7%
div-sub92.7%
*-commutative92.7%
associate-*l/87.8%
associate-/r/92.8%
*-inverses92.8%
/-rgt-identity92.8%
Simplified92.8%
Taylor expanded in a around 0 81.9%
if 1.20000000000000003e-73 < z < 1.7e-33Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 88.6%
*-commutative88.6%
Simplified88.6%
if 1.7e-33 < z < 3.2e8Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
Final simplification81.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y) (- (/ t z) a))) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -1.85e+83)
t_2
(if (<= z -4.5e+53)
t_1
(if (<= z -6.5e-11)
(- (/ y a) (/ x (* z a)))
(if (<= z 1.5e-74)
(- (/ x t) (/ (* z y) t))
(if (<= z 1.8e-33)
(/ x (- t (* z a)))
(if (<= z 245000000.0)
(/ (- x (* z y)) t)
(if (<= z 3.95e+62) t_2 t_1)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -y / ((t / z) - a);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.85e+83) {
tmp = t_2;
} else if (z <= -4.5e+53) {
tmp = t_1;
} else if (z <= -6.5e-11) {
tmp = (y / a) - (x / (z * a));
} else if (z <= 1.5e-74) {
tmp = (x / t) - ((z * y) / t);
} else if (z <= 1.8e-33) {
tmp = x / (t - (z * a));
} else if (z <= 245000000.0) {
tmp = (x - (z * y)) / t;
} else if (z <= 3.95e+62) {
tmp = t_2;
} else {
tmp = t_1;
}
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 / ((t / z) - a)
t_2 = (y - (x / z)) / a
if (z <= (-1.85d+83)) then
tmp = t_2
else if (z <= (-4.5d+53)) then
tmp = t_1
else if (z <= (-6.5d-11)) then
tmp = (y / a) - (x / (z * a))
else if (z <= 1.5d-74) then
tmp = (x / t) - ((z * y) / t)
else if (z <= 1.8d-33) then
tmp = x / (t - (z * a))
else if (z <= 245000000.0d0) then
tmp = (x - (z * y)) / t
else if (z <= 3.95d+62) then
tmp = t_2
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 t_1 = -y / ((t / z) - a);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.85e+83) {
tmp = t_2;
} else if (z <= -4.5e+53) {
tmp = t_1;
} else if (z <= -6.5e-11) {
tmp = (y / a) - (x / (z * a));
} else if (z <= 1.5e-74) {
tmp = (x / t) - ((z * y) / t);
} else if (z <= 1.8e-33) {
tmp = x / (t - (z * a));
} else if (z <= 245000000.0) {
tmp = (x - (z * y)) / t;
} else if (z <= 3.95e+62) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -y / ((t / z) - a) t_2 = (y - (x / z)) / a tmp = 0 if z <= -1.85e+83: tmp = t_2 elif z <= -4.5e+53: tmp = t_1 elif z <= -6.5e-11: tmp = (y / a) - (x / (z * a)) elif z <= 1.5e-74: tmp = (x / t) - ((z * y) / t) elif z <= 1.8e-33: tmp = x / (t - (z * a)) elif z <= 245000000.0: tmp = (x - (z * y)) / t elif z <= 3.95e+62: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-y) / Float64(Float64(t / z) - a)) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -1.85e+83) tmp = t_2; elseif (z <= -4.5e+53) tmp = t_1; elseif (z <= -6.5e-11) tmp = Float64(Float64(y / a) - Float64(x / Float64(z * a))); elseif (z <= 1.5e-74) tmp = Float64(Float64(x / t) - Float64(Float64(z * y) / t)); elseif (z <= 1.8e-33) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 245000000.0) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 3.95e+62) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -y / ((t / z) - a); t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -1.85e+83) tmp = t_2; elseif (z <= -4.5e+53) tmp = t_1; elseif (z <= -6.5e-11) tmp = (y / a) - (x / (z * a)); elseif (z <= 1.5e-74) tmp = (x / t) - ((z * y) / t); elseif (z <= 1.8e-33) tmp = x / (t - (z * a)); elseif (z <= 245000000.0) tmp = (x - (z * y)) / t; elseif (z <= 3.95e+62) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1.85e+83], t$95$2, If[LessEqual[z, -4.5e+53], t$95$1, If[LessEqual[z, -6.5e-11], N[(N[(y / a), $MachinePrecision] - N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e-74], N[(N[(x / t), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-33], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 245000000.0], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.95e+62], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-y}{\frac{t}{z} - a}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+83}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{t} - \frac{z \cdot y}{t}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 245000000:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 3.95 \cdot 10^{+62}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.8500000000000001e83 or 2.45e8 < z < 3.9499999999999998e62Initial program 69.0%
*-commutative69.0%
Simplified69.0%
clear-num68.9%
associate-/r/69.0%
sub-neg69.0%
+-commutative69.0%
*-commutative69.0%
distribute-rgt-neg-in69.0%
fma-def69.0%
Applied egg-rr69.0%
Taylor expanded in x around 0 69.0%
+-commutative69.0%
mul-1-neg69.0%
unsub-neg69.0%
mul-1-neg69.0%
sub-neg69.0%
*-commutative69.0%
associate-/l*75.2%
mul-1-neg75.2%
sub-neg75.2%
*-commutative75.2%
div-sub75.2%
*-commutative75.2%
associate-*l/75.9%
associate-/r/89.9%
*-inverses89.9%
/-rgt-identity89.9%
Simplified89.9%
Taylor expanded in t around 0 75.5%
sub-neg75.5%
mul-1-neg75.5%
remove-double-neg75.5%
+-commutative75.5%
mul-1-neg75.5%
associate-/l/85.3%
sub-neg85.3%
div-sub85.3%
Simplified85.3%
if -1.8500000000000001e83 < z < -4.5000000000000002e53 or 3.9499999999999998e62 < z Initial program 61.2%
*-commutative61.2%
Simplified61.2%
clear-num60.2%
associate-/r/61.1%
sub-neg61.1%
+-commutative61.1%
*-commutative61.1%
distribute-rgt-neg-in61.1%
fma-def61.1%
Applied egg-rr61.1%
Taylor expanded in x around 0 36.3%
mul-1-neg36.3%
associate-/l*56.4%
distribute-neg-frac56.4%
mul-1-neg56.4%
sub-neg56.4%
*-commutative56.4%
div-sub56.4%
*-commutative56.4%
associate-*l/69.7%
associate-/r/73.7%
*-inverses73.7%
/-rgt-identity73.7%
Simplified73.7%
if -4.5000000000000002e53 < z < -6.49999999999999953e-11Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 93.0%
associate-*r*93.0%
neg-mul-193.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in x around 0 93.3%
+-commutative93.3%
mul-1-neg93.3%
unsub-neg93.3%
*-commutative93.3%
Simplified93.3%
if -6.49999999999999953e-11 < z < 1.50000000000000003e-74Initial program 99.9%
*-commutative99.9%
Simplified99.9%
clear-num98.9%
associate-/r/99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
mul-1-neg99.9%
sub-neg99.9%
*-commutative99.9%
associate-/l*92.7%
mul-1-neg92.7%
sub-neg92.7%
*-commutative92.7%
div-sub92.7%
*-commutative92.7%
associate-*l/87.8%
associate-/r/92.8%
*-inverses92.8%
/-rgt-identity92.8%
Simplified92.8%
Taylor expanded in a around 0 81.9%
if 1.50000000000000003e-74 < z < 1.80000000000000017e-33Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 88.6%
*-commutative88.6%
Simplified88.6%
if 1.80000000000000017e-33 < z < 2.45e8Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
Final simplification81.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (/ (- x) a) z)))
(if (<= z -1.05e+120)
(/ y a)
(if (<= z -4500000.0)
t_1
(if (<= z -4e-69)
(/ y a)
(if (<= z 5.2e-82)
(/ x t)
(if (<= z 3.5e+29)
t_1
(if (or (<= z 2.2e+117) (not (<= z 3.6e+222)))
(/ y a)
(- (/ y (/ t z)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (-x / a) / z;
double tmp;
if (z <= -1.05e+120) {
tmp = y / a;
} else if (z <= -4500000.0) {
tmp = t_1;
} else if (z <= -4e-69) {
tmp = y / a;
} else if (z <= 5.2e-82) {
tmp = x / t;
} else if (z <= 3.5e+29) {
tmp = t_1;
} else if ((z <= 2.2e+117) || !(z <= 3.6e+222)) {
tmp = y / a;
} else {
tmp = -(y / (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) :: tmp
t_1 = (-x / a) / z
if (z <= (-1.05d+120)) then
tmp = y / a
else if (z <= (-4500000.0d0)) then
tmp = t_1
else if (z <= (-4d-69)) then
tmp = y / a
else if (z <= 5.2d-82) then
tmp = x / t
else if (z <= 3.5d+29) then
tmp = t_1
else if ((z <= 2.2d+117) .or. (.not. (z <= 3.6d+222))) then
tmp = y / a
else
tmp = -(y / (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 / a) / z;
double tmp;
if (z <= -1.05e+120) {
tmp = y / a;
} else if (z <= -4500000.0) {
tmp = t_1;
} else if (z <= -4e-69) {
tmp = y / a;
} else if (z <= 5.2e-82) {
tmp = x / t;
} else if (z <= 3.5e+29) {
tmp = t_1;
} else if ((z <= 2.2e+117) || !(z <= 3.6e+222)) {
tmp = y / a;
} else {
tmp = -(y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (-x / a) / z tmp = 0 if z <= -1.05e+120: tmp = y / a elif z <= -4500000.0: tmp = t_1 elif z <= -4e-69: tmp = y / a elif z <= 5.2e-82: tmp = x / t elif z <= 3.5e+29: tmp = t_1 elif (z <= 2.2e+117) or not (z <= 3.6e+222): tmp = y / a else: tmp = -(y / (t / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(-x) / a) / z) tmp = 0.0 if (z <= -1.05e+120) tmp = Float64(y / a); elseif (z <= -4500000.0) tmp = t_1; elseif (z <= -4e-69) tmp = Float64(y / a); elseif (z <= 5.2e-82) tmp = Float64(x / t); elseif (z <= 3.5e+29) tmp = t_1; elseif ((z <= 2.2e+117) || !(z <= 3.6e+222)) tmp = Float64(y / a); else tmp = Float64(-Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (-x / a) / z; tmp = 0.0; if (z <= -1.05e+120) tmp = y / a; elseif (z <= -4500000.0) tmp = t_1; elseif (z <= -4e-69) tmp = y / a; elseif (z <= 5.2e-82) tmp = x / t; elseif (z <= 3.5e+29) tmp = t_1; elseif ((z <= 2.2e+117) || ~((z <= 3.6e+222))) tmp = y / a; else tmp = -(y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1.05e+120], N[(y / a), $MachinePrecision], If[LessEqual[z, -4500000.0], t$95$1, If[LessEqual[z, -4e-69], N[(y / a), $MachinePrecision], If[LessEqual[z, 5.2e-82], N[(x / t), $MachinePrecision], If[LessEqual[z, 3.5e+29], t$95$1, If[Or[LessEqual[z, 2.2e+117], N[Not[LessEqual[z, 3.6e+222]], $MachinePrecision]], N[(y / a), $MachinePrecision], (-N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision])]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{-x}{a}}{z}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+120}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -4500000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-69}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+117} \lor \neg \left(z \leq 3.6 \cdot 10^{+222}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;-\frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if z < -1.05e120 or -4.5e6 < z < -3.9999999999999999e-69 or 3.49999999999999979e29 < z < 2.20000000000000014e117 or 3.6000000000000002e222 < z Initial program 63.7%
*-commutative63.7%
Simplified63.7%
Taylor expanded in z around inf 64.4%
if -1.05e120 < z < -4.5e6 or 5.2e-82 < z < 3.49999999999999979e29Initial program 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in x around inf 63.6%
*-commutative63.6%
Simplified63.6%
Taylor expanded in t around 0 46.2%
mul-1-neg46.2%
associate-/r*53.2%
Simplified53.2%
if -3.9999999999999999e-69 < z < 5.2e-82Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 66.5%
if 2.20000000000000014e117 < z < 3.6000000000000002e222Initial program 71.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in x around 0 36.7%
mul-1-neg36.7%
associate-/l*54.3%
*-commutative54.3%
Simplified54.3%
Taylor expanded in t around inf 46.5%
Final simplification60.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* z y)) t)) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -1.55e-9)
t_2
(if (<= z 3.5e-73)
t_1
(if (<= z 1.25e-33)
(/ x (- t (* z a)))
(if (<= z 26000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (z * y)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.55e-9) {
tmp = t_2;
} else if (z <= 3.5e-73) {
tmp = t_1;
} else if (z <= 1.25e-33) {
tmp = x / (t - (z * a));
} else if (z <= 26000000.0) {
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 = (x - (z * y)) / t
t_2 = (y - (x / z)) / a
if (z <= (-1.55d-9)) then
tmp = t_2
else if (z <= 3.5d-73) then
tmp = t_1
else if (z <= 1.25d-33) then
tmp = x / (t - (z * a))
else if (z <= 26000000.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 t_1 = (x - (z * y)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.55e-9) {
tmp = t_2;
} else if (z <= 3.5e-73) {
tmp = t_1;
} else if (z <= 1.25e-33) {
tmp = x / (t - (z * a));
} else if (z <= 26000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (z * y)) / t t_2 = (y - (x / z)) / a tmp = 0 if z <= -1.55e-9: tmp = t_2 elif z <= 3.5e-73: tmp = t_1 elif z <= 1.25e-33: tmp = x / (t - (z * a)) elif z <= 26000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(z * y)) / t) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -1.55e-9) tmp = t_2; elseif (z <= 3.5e-73) tmp = t_1; elseif (z <= 1.25e-33) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 26000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (z * y)) / t; t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -1.55e-9) tmp = t_2; elseif (z <= 3.5e-73) tmp = t_1; elseif (z <= 1.25e-33) tmp = x / (t - (z * a)); elseif (z <= 26000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1.55e-9], t$95$2, If[LessEqual[z, 3.5e-73], t$95$1, If[LessEqual[z, 1.25e-33], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 26000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - z \cdot y}{t}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{-9}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 26000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.55000000000000002e-9 or 2.6e7 < z Initial program 68.1%
*-commutative68.1%
Simplified68.1%
clear-num67.5%
associate-/r/68.0%
sub-neg68.0%
+-commutative68.0%
*-commutative68.0%
distribute-rgt-neg-in68.0%
fma-def68.0%
Applied egg-rr68.0%
Taylor expanded in x around 0 68.1%
+-commutative68.1%
mul-1-neg68.1%
unsub-neg68.1%
mul-1-neg68.1%
sub-neg68.1%
*-commutative68.1%
associate-/l*81.1%
mul-1-neg81.1%
sub-neg81.1%
*-commutative81.1%
div-sub81.1%
*-commutative81.1%
associate-*l/85.8%
associate-/r/95.7%
*-inverses95.7%
/-rgt-identity95.7%
Simplified95.7%
Taylor expanded in t around 0 67.9%
sub-neg67.9%
mul-1-neg67.9%
remove-double-neg67.9%
+-commutative67.9%
mul-1-neg67.9%
associate-/l/72.0%
sub-neg72.0%
div-sub72.0%
Simplified72.0%
if -1.55000000000000002e-9 < z < 3.4999999999999998e-73 or 1.25000000000000007e-33 < z < 2.6e7Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 83.1%
if 3.4999999999999998e-73 < z < 1.25000000000000007e-33Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 88.6%
*-commutative88.6%
Simplified88.6%
Final simplification77.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.85e+36)
(/ y a)
(if (or (<= a -7.2e-127) (not (<= a 1.62e-102)))
(/ x (- t (* z a)))
(/ (- x (* z y)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.85e+36) {
tmp = y / a;
} else if ((a <= -7.2e-127) || !(a <= 1.62e-102)) {
tmp = x / (t - (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 (a <= (-1.85d+36)) then
tmp = y / a
else if ((a <= (-7.2d-127)) .or. (.not. (a <= 1.62d-102))) then
tmp = x / (t - (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 (a <= -1.85e+36) {
tmp = y / a;
} else if ((a <= -7.2e-127) || !(a <= 1.62e-102)) {
tmp = x / (t - (z * a));
} else {
tmp = (x - (z * y)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.85e+36: tmp = y / a elif (a <= -7.2e-127) or not (a <= 1.62e-102): tmp = x / (t - (z * a)) else: tmp = (x - (z * y)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.85e+36) tmp = Float64(y / a); elseif ((a <= -7.2e-127) || !(a <= 1.62e-102)) tmp = Float64(x / Float64(t - Float64(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 (a <= -1.85e+36) tmp = y / a; elseif ((a <= -7.2e-127) || ~((a <= 1.62e-102))) tmp = x / (t - (z * a)); else tmp = (x - (z * y)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.85e+36], N[(y / a), $MachinePrecision], If[Or[LessEqual[a, -7.2e-127], N[Not[LessEqual[a, 1.62e-102]], $MachinePrecision]], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.85 \cdot 10^{+36}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;a \leq -7.2 \cdot 10^{-127} \lor \neg \left(a \leq 1.62 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\end{array}
\end{array}
if a < -1.85000000000000014e36Initial program 67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in z around inf 63.9%
if -1.85000000000000014e36 < a < -7.1999999999999999e-127 or 1.61999999999999996e-102 < a Initial program 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x around inf 65.0%
*-commutative65.0%
Simplified65.0%
if -7.1999999999999999e-127 < a < 1.61999999999999996e-102Initial program 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in t around inf 74.9%
Final simplification68.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4e-69)
(/ y a)
(if (<= z 2.65e-31)
(/ x t)
(if (<= z 5.3e+222) (- (/ y (/ t z))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-69) {
tmp = y / a;
} else if (z <= 2.65e-31) {
tmp = x / t;
} else if (z <= 5.3e+222) {
tmp = -(y / (t / z));
} 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 <= (-4d-69)) then
tmp = y / a
else if (z <= 2.65d-31) then
tmp = x / t
else if (z <= 5.3d+222) then
tmp = -(y / (t / z))
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 <= -4e-69) {
tmp = y / a;
} else if (z <= 2.65e-31) {
tmp = x / t;
} else if (z <= 5.3e+222) {
tmp = -(y / (t / z));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4e-69: tmp = y / a elif z <= 2.65e-31: tmp = x / t elif z <= 5.3e+222: tmp = -(y / (t / z)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e-69) tmp = Float64(y / a); elseif (z <= 2.65e-31) tmp = Float64(x / t); elseif (z <= 5.3e+222) tmp = Float64(-Float64(y / Float64(t / z))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4e-69) tmp = y / a; elseif (z <= 2.65e-31) tmp = x / t; elseif (z <= 5.3e+222) tmp = -(y / (t / z)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e-69], N[(y / a), $MachinePrecision], If[LessEqual[z, 2.65e-31], N[(x / t), $MachinePrecision], If[LessEqual[z, 5.3e+222], (-N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-69}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-31}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+222}:\\
\;\;\;\;-\frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.9999999999999999e-69 or 5.29999999999999993e222 < z Initial program 68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in z around inf 59.2%
if -3.9999999999999999e-69 < z < 2.65e-31Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 63.0%
if 2.65e-31 < z < 5.29999999999999993e222Initial program 75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in x around 0 40.0%
mul-1-neg40.0%
associate-/l*53.0%
*-commutative53.0%
Simplified53.0%
Taylor expanded in t around inf 38.1%
Final simplification55.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.2e+150) (not (<= z 5.1e+219))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.2e+150) || !(z <= 5.1e+219)) {
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 <= (-4.2d+150)) .or. (.not. (z <= 5.1d+219))) 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 <= -4.2e+150) || !(z <= 5.1e+219)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.2e+150) or not (z <= 5.1e+219): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.2e+150) || !(z <= 5.1e+219)) 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 <= -4.2e+150) || ~((z <= 5.1e+219))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.2e+150], N[Not[LessEqual[z, 5.1e+219]], $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 -4.2 \cdot 10^{+150} \lor \neg \left(z \leq 5.1 \cdot 10^{+219}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -4.19999999999999996e150 or 5.09999999999999993e219 < z Initial program 47.8%
*-commutative47.8%
Simplified47.8%
Taylor expanded in z around inf 75.1%
if -4.19999999999999996e150 < z < 5.09999999999999993e219Initial program 91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in x around inf 65.0%
*-commutative65.0%
Simplified65.0%
Final simplification67.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.95e-69) (not (<= z 6.5e+45))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.95e-69) || !(z <= 6.5e+45)) {
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 <= (-1.95d-69)) .or. (.not. (z <= 6.5d+45))) 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 <= -1.95e-69) || !(z <= 6.5e+45)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.95e-69) or not (z <= 6.5e+45): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.95e-69) || !(z <= 6.5e+45)) 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 <= -1.95e-69) || ~((z <= 6.5e+45))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.95e-69], N[Not[LessEqual[z, 6.5e+45]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-69} \lor \neg \left(z \leq 6.5 \cdot 10^{+45}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -1.9499999999999999e-69 or 6.50000000000000034e45 < z Initial program 69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in z around inf 49.9%
if -1.9499999999999999e-69 < z < 6.50000000000000034e45Initial program 98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in z around 0 59.3%
Final simplification54.1%
(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 82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in z around 0 34.3%
Final simplification34.3%
(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 2023334
(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))))