
(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
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_2 -5e-305)
(- (/ y (/ t_1 z)) (/ x t_1))
(if (<= t_2 0.0)
(/ (- y (/ x z)) a)
(if (<= t_2 1e+231) t_2 (+ (/ y a) (/ -1.0 (/ t_1 x))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_2 <= -5e-305) {
tmp = (y / (t_1 / z)) - (x / t_1);
} else if (t_2 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_2 <= 1e+231) {
tmp = t_2;
} else {
tmp = (y / a) + (-1.0 / (t_1 / x));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * a) - t
t_2 = (x - (y * z)) / (t - (z * a))
if (t_2 <= (-5d-305)) then
tmp = (y / (t_1 / z)) - (x / t_1)
else if (t_2 <= 0.0d0) then
tmp = (y - (x / z)) / a
else if (t_2 <= 1d+231) then
tmp = t_2
else
tmp = (y / a) + ((-1.0d0) / (t_1 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_2 <= -5e-305) {
tmp = (y / (t_1 / z)) - (x / t_1);
} else if (t_2 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_2 <= 1e+231) {
tmp = t_2;
} else {
tmp = (y / a) + (-1.0 / (t_1 / x));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = (x - (y * z)) / (t - (z * a)) tmp = 0 if t_2 <= -5e-305: tmp = (y / (t_1 / z)) - (x / t_1) elif t_2 <= 0.0: tmp = (y - (x / z)) / a elif t_2 <= 1e+231: tmp = t_2 else: tmp = (y / a) + (-1.0 / (t_1 / x)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_2 <= -5e-305) tmp = Float64(Float64(y / Float64(t_1 / z)) - Float64(x / t_1)); elseif (t_2 <= 0.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (t_2 <= 1e+231) tmp = t_2; else tmp = Float64(Float64(y / a) + Float64(-1.0 / Float64(t_1 / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = (x - (y * z)) / (t - (z * a)); tmp = 0.0; if (t_2 <= -5e-305) tmp = (y / (t_1 / z)) - (x / t_1); elseif (t_2 <= 0.0) tmp = (y - (x / z)) / a; elseif (t_2 <= 1e+231) tmp = t_2; else tmp = (y / a) + (-1.0 / (t_1 / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-305], N[(N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, 1e+231], t$95$2, N[(N[(y / a), $MachinePrecision] + N[(-1.0 / N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{-305}:\\
\;\;\;\;\frac{y}{\frac{t_1}{z}} - \frac{x}{t_1}\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t_2 \leq 10^{+231}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} + \frac{-1}{\frac{t_1}{x}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99999999999999985e-305Initial program 94.5%
sub-neg94.5%
+-commutative94.5%
neg-sub094.5%
associate-+l-94.5%
sub0-neg94.5%
neg-mul-194.5%
sub-neg94.5%
+-commutative94.5%
neg-sub094.5%
associate-+l-94.5%
sub0-neg94.5%
neg-mul-194.5%
times-frac94.5%
metadata-eval94.5%
*-lft-identity94.5%
*-commutative94.5%
Simplified94.5%
div-sub94.5%
associate-/l*97.9%
Applied egg-rr97.9%
if -4.99999999999999985e-305 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 60.1%
sub-neg60.1%
+-commutative60.1%
neg-sub060.1%
associate-+l-60.1%
sub0-neg60.1%
neg-mul-160.1%
sub-neg60.1%
+-commutative60.1%
neg-sub060.1%
associate-+l-60.1%
sub0-neg60.1%
neg-mul-160.1%
times-frac60.1%
metadata-eval60.1%
*-lft-identity60.1%
*-commutative60.1%
Simplified60.1%
div-sub60.1%
associate-/l*60.1%
Applied egg-rr60.1%
Taylor expanded in a around inf 87.1%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.0000000000000001e231Initial program 99.6%
if 1.0000000000000001e231 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 39.0%
sub-neg39.0%
+-commutative39.0%
neg-sub039.0%
associate-+l-39.0%
sub0-neg39.0%
neg-mul-139.0%
sub-neg39.0%
+-commutative39.0%
neg-sub039.0%
associate-+l-39.0%
sub0-neg39.0%
neg-mul-139.0%
times-frac39.0%
metadata-eval39.0%
*-lft-identity39.0%
*-commutative39.0%
Simplified39.0%
div-sub39.0%
associate-/l*60.0%
Applied egg-rr60.0%
clear-num60.0%
inv-pow60.0%
Applied egg-rr60.0%
unpow-160.0%
Simplified60.0%
Taylor expanded in z around inf 93.3%
Final simplification96.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t))
(t_2 (/ (- y (/ x z)) a))
(t_3 (/ (- x) t_1))
(t_4 (/ (- x (* y z)) t)))
(if (<= z -3.65e+196)
t_2
(if (<= z -1.7e-15)
(* y (/ z t_1))
(if (<= z -5.6e-261)
t_3
(if (<= z 4.2e-292)
t_4
(if (<= z 1.35e-106) t_3 (if (<= z 3.8e-42) t_4 t_2))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (y - (x / z)) / a;
double t_3 = -x / t_1;
double t_4 = (x - (y * z)) / t;
double tmp;
if (z <= -3.65e+196) {
tmp = t_2;
} else if (z <= -1.7e-15) {
tmp = y * (z / t_1);
} else if (z <= -5.6e-261) {
tmp = t_3;
} else if (z <= 4.2e-292) {
tmp = t_4;
} else if (z <= 1.35e-106) {
tmp = t_3;
} else if (z <= 3.8e-42) {
tmp = t_4;
} 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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (z * a) - t
t_2 = (y - (x / z)) / a
t_3 = -x / t_1
t_4 = (x - (y * z)) / t
if (z <= (-3.65d+196)) then
tmp = t_2
else if (z <= (-1.7d-15)) then
tmp = y * (z / t_1)
else if (z <= (-5.6d-261)) then
tmp = t_3
else if (z <= 4.2d-292) then
tmp = t_4
else if (z <= 1.35d-106) then
tmp = t_3
else if (z <= 3.8d-42) then
tmp = t_4
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (y - (x / z)) / a;
double t_3 = -x / t_1;
double t_4 = (x - (y * z)) / t;
double tmp;
if (z <= -3.65e+196) {
tmp = t_2;
} else if (z <= -1.7e-15) {
tmp = y * (z / t_1);
} else if (z <= -5.6e-261) {
tmp = t_3;
} else if (z <= 4.2e-292) {
tmp = t_4;
} else if (z <= 1.35e-106) {
tmp = t_3;
} else if (z <= 3.8e-42) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = (y - (x / z)) / a t_3 = -x / t_1 t_4 = (x - (y * z)) / t tmp = 0 if z <= -3.65e+196: tmp = t_2 elif z <= -1.7e-15: tmp = y * (z / t_1) elif z <= -5.6e-261: tmp = t_3 elif z <= 4.2e-292: tmp = t_4 elif z <= 1.35e-106: tmp = t_3 elif z <= 3.8e-42: tmp = t_4 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(y - Float64(x / z)) / a) t_3 = Float64(Float64(-x) / t_1) t_4 = Float64(Float64(x - Float64(y * z)) / t) tmp = 0.0 if (z <= -3.65e+196) tmp = t_2; elseif (z <= -1.7e-15) tmp = Float64(y * Float64(z / t_1)); elseif (z <= -5.6e-261) tmp = t_3; elseif (z <= 4.2e-292) tmp = t_4; elseif (z <= 1.35e-106) tmp = t_3; elseif (z <= 3.8e-42) tmp = t_4; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = (y - (x / z)) / a; t_3 = -x / t_1; t_4 = (x - (y * z)) / t; tmp = 0.0; if (z <= -3.65e+196) tmp = t_2; elseif (z <= -1.7e-15) tmp = y * (z / t_1); elseif (z <= -5.6e-261) tmp = t_3; elseif (z <= 4.2e-292) tmp = t_4; elseif (z <= 1.35e-106) tmp = t_3; elseif (z <= 3.8e-42) tmp = t_4; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[((-x) / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -3.65e+196], t$95$2, If[LessEqual[z, -1.7e-15], N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.6e-261], t$95$3, If[LessEqual[z, 4.2e-292], t$95$4, If[LessEqual[z, 1.35e-106], t$95$3, If[LessEqual[z, 3.8e-42], t$95$4, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
t_3 := \frac{-x}{t_1}\\
t_4 := \frac{x - y \cdot z}{t}\\
\mathbf{if}\;z \leq -3.65 \cdot 10^{+196}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-15}:\\
\;\;\;\;y \cdot \frac{z}{t_1}\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-261}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-292}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-106}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-42}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.64999999999999999e196 or 3.80000000000000017e-42 < z Initial program 71.1%
sub-neg71.1%
+-commutative71.1%
neg-sub071.1%
associate-+l-71.1%
sub0-neg71.1%
neg-mul-171.1%
sub-neg71.1%
+-commutative71.1%
neg-sub071.1%
associate-+l-71.1%
sub0-neg71.1%
neg-mul-171.1%
times-frac71.1%
metadata-eval71.1%
*-lft-identity71.1%
*-commutative71.1%
Simplified71.1%
div-sub71.0%
associate-/l*80.0%
Applied egg-rr80.0%
Taylor expanded in a around inf 78.6%
if -3.64999999999999999e196 < z < -1.7e-15Initial program 84.9%
sub-neg84.9%
+-commutative84.9%
neg-sub084.9%
associate-+l-84.9%
sub0-neg84.9%
neg-mul-184.9%
sub-neg84.9%
+-commutative84.9%
neg-sub084.9%
associate-+l-84.9%
sub0-neg84.9%
neg-mul-184.9%
times-frac84.9%
metadata-eval84.9%
*-lft-identity84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
associate-*r/73.3%
*-commutative73.3%
Simplified73.3%
if -1.7e-15 < z < -5.60000000000000018e-261 or 4.19999999999999977e-292 < z < 1.35000000000000011e-106Initial 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 79.5%
associate-*r/79.5%
neg-mul-179.5%
Simplified79.5%
if -5.60000000000000018e-261 < z < 4.19999999999999977e-292 or 1.35000000000000011e-106 < z < 3.80000000000000017e-42Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 65.0%
*-commutative65.0%
distribute-lft-out--65.0%
associate-/l*74.1%
unpow274.1%
Simplified74.1%
Taylor expanded in y around inf 83.3%
Taylor expanded in t around 0 95.4%
+-commutative95.4%
mul-1-neg95.4%
unsub-neg95.4%
*-commutative95.4%
Simplified95.4%
Final simplification79.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t))
(t_2 (/ (- y (/ x z)) a))
(t_3 (/ (- x) t_1))
(t_4 (/ (- x (* y z)) t)))
(if (<= z -3.6e+196)
t_2
(if (<= z -1.95e-16)
(/ y (/ t_1 z))
(if (<= z -6.3e-260)
t_3
(if (<= z 8e-293)
t_4
(if (<= z 1.28e-107) t_3 (if (<= z 3.25e-37) t_4 t_2))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (y - (x / z)) / a;
double t_3 = -x / t_1;
double t_4 = (x - (y * z)) / t;
double tmp;
if (z <= -3.6e+196) {
tmp = t_2;
} else if (z <= -1.95e-16) {
tmp = y / (t_1 / z);
} else if (z <= -6.3e-260) {
tmp = t_3;
} else if (z <= 8e-293) {
tmp = t_4;
} else if (z <= 1.28e-107) {
tmp = t_3;
} else if (z <= 3.25e-37) {
tmp = t_4;
} 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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (z * a) - t
t_2 = (y - (x / z)) / a
t_3 = -x / t_1
t_4 = (x - (y * z)) / t
if (z <= (-3.6d+196)) then
tmp = t_2
else if (z <= (-1.95d-16)) then
tmp = y / (t_1 / z)
else if (z <= (-6.3d-260)) then
tmp = t_3
else if (z <= 8d-293) then
tmp = t_4
else if (z <= 1.28d-107) then
tmp = t_3
else if (z <= 3.25d-37) then
tmp = t_4
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (y - (x / z)) / a;
double t_3 = -x / t_1;
double t_4 = (x - (y * z)) / t;
double tmp;
if (z <= -3.6e+196) {
tmp = t_2;
} else if (z <= -1.95e-16) {
tmp = y / (t_1 / z);
} else if (z <= -6.3e-260) {
tmp = t_3;
} else if (z <= 8e-293) {
tmp = t_4;
} else if (z <= 1.28e-107) {
tmp = t_3;
} else if (z <= 3.25e-37) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = (y - (x / z)) / a t_3 = -x / t_1 t_4 = (x - (y * z)) / t tmp = 0 if z <= -3.6e+196: tmp = t_2 elif z <= -1.95e-16: tmp = y / (t_1 / z) elif z <= -6.3e-260: tmp = t_3 elif z <= 8e-293: tmp = t_4 elif z <= 1.28e-107: tmp = t_3 elif z <= 3.25e-37: tmp = t_4 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(y - Float64(x / z)) / a) t_3 = Float64(Float64(-x) / t_1) t_4 = Float64(Float64(x - Float64(y * z)) / t) tmp = 0.0 if (z <= -3.6e+196) tmp = t_2; elseif (z <= -1.95e-16) tmp = Float64(y / Float64(t_1 / z)); elseif (z <= -6.3e-260) tmp = t_3; elseif (z <= 8e-293) tmp = t_4; elseif (z <= 1.28e-107) tmp = t_3; elseif (z <= 3.25e-37) tmp = t_4; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = (y - (x / z)) / a; t_3 = -x / t_1; t_4 = (x - (y * z)) / t; tmp = 0.0; if (z <= -3.6e+196) tmp = t_2; elseif (z <= -1.95e-16) tmp = y / (t_1 / z); elseif (z <= -6.3e-260) tmp = t_3; elseif (z <= 8e-293) tmp = t_4; elseif (z <= 1.28e-107) tmp = t_3; elseif (z <= 3.25e-37) tmp = t_4; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[((-x) / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -3.6e+196], t$95$2, If[LessEqual[z, -1.95e-16], N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.3e-260], t$95$3, If[LessEqual[z, 8e-293], t$95$4, If[LessEqual[z, 1.28e-107], t$95$3, If[LessEqual[z, 3.25e-37], t$95$4, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
t_3 := \frac{-x}{t_1}\\
t_4 := \frac{x - y \cdot z}{t}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+196}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-16}:\\
\;\;\;\;\frac{y}{\frac{t_1}{z}}\\
\mathbf{elif}\;z \leq -6.3 \cdot 10^{-260}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-293}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{-107}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{-37}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.60000000000000007e196 or 3.2500000000000001e-37 < z Initial program 71.1%
sub-neg71.1%
+-commutative71.1%
neg-sub071.1%
associate-+l-71.1%
sub0-neg71.1%
neg-mul-171.1%
sub-neg71.1%
+-commutative71.1%
neg-sub071.1%
associate-+l-71.1%
sub0-neg71.1%
neg-mul-171.1%
times-frac71.1%
metadata-eval71.1%
*-lft-identity71.1%
*-commutative71.1%
Simplified71.1%
div-sub71.0%
associate-/l*80.0%
Applied egg-rr80.0%
Taylor expanded in a around inf 78.6%
if -3.60000000000000007e196 < z < -1.94999999999999989e-16Initial program 84.9%
sub-neg84.9%
+-commutative84.9%
neg-sub084.9%
associate-+l-84.9%
sub0-neg84.9%
neg-mul-184.9%
sub-neg84.9%
+-commutative84.9%
neg-sub084.9%
associate-+l-84.9%
sub0-neg84.9%
neg-mul-184.9%
times-frac84.9%
metadata-eval84.9%
*-lft-identity84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
associate-*r/73.3%
*-commutative73.3%
Simplified73.3%
clear-num73.2%
*-commutative73.2%
div-inv73.4%
Applied egg-rr73.4%
if -1.94999999999999989e-16 < z < -6.29999999999999978e-260 or 8.0000000000000004e-293 < z < 1.28e-107Initial 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 79.5%
associate-*r/79.5%
neg-mul-179.5%
Simplified79.5%
if -6.29999999999999978e-260 < z < 8.0000000000000004e-293 or 1.28e-107 < z < 3.2500000000000001e-37Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 65.0%
*-commutative65.0%
distribute-lft-out--65.0%
associate-/l*74.1%
unpow274.1%
Simplified74.1%
Taylor expanded in y around inf 83.3%
Taylor expanded in t around 0 95.4%
+-commutative95.4%
mul-1-neg95.4%
unsub-neg95.4%
*-commutative95.4%
Simplified95.4%
Final simplification79.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x) (- (* z a) t)))
(t_2 (/ (- y (/ x z)) a))
(t_3 (/ (- x (* y z)) t)))
(if (<= z -7.5e-10)
t_2
(if (<= z -6.3e-261)
t_1
(if (<= z 1.3e-292)
t_3
(if (<= z 5.8e-107) t_1 (if (<= z 1.45e-38) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -x / ((z * a) - t);
double t_2 = (y - (x / z)) / a;
double t_3 = (x - (y * z)) / t;
double tmp;
if (z <= -7.5e-10) {
tmp = t_2;
} else if (z <= -6.3e-261) {
tmp = t_1;
} else if (z <= 1.3e-292) {
tmp = t_3;
} else if (z <= 5.8e-107) {
tmp = t_1;
} else if (z <= 1.45e-38) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = -x / ((z * a) - t)
t_2 = (y - (x / z)) / a
t_3 = (x - (y * z)) / t
if (z <= (-7.5d-10)) then
tmp = t_2
else if (z <= (-6.3d-261)) then
tmp = t_1
else if (z <= 1.3d-292) then
tmp = t_3
else if (z <= 5.8d-107) then
tmp = t_1
else if (z <= 1.45d-38) then
tmp = t_3
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 * a) - t);
double t_2 = (y - (x / z)) / a;
double t_3 = (x - (y * z)) / t;
double tmp;
if (z <= -7.5e-10) {
tmp = t_2;
} else if (z <= -6.3e-261) {
tmp = t_1;
} else if (z <= 1.3e-292) {
tmp = t_3;
} else if (z <= 5.8e-107) {
tmp = t_1;
} else if (z <= 1.45e-38) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -x / ((z * a) - t) t_2 = (y - (x / z)) / a t_3 = (x - (y * z)) / t tmp = 0 if z <= -7.5e-10: tmp = t_2 elif z <= -6.3e-261: tmp = t_1 elif z <= 1.3e-292: tmp = t_3 elif z <= 5.8e-107: tmp = t_1 elif z <= 1.45e-38: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-x) / Float64(Float64(z * a) - t)) t_2 = Float64(Float64(y - Float64(x / z)) / a) t_3 = Float64(Float64(x - Float64(y * z)) / t) tmp = 0.0 if (z <= -7.5e-10) tmp = t_2; elseif (z <= -6.3e-261) tmp = t_1; elseif (z <= 1.3e-292) tmp = t_3; elseif (z <= 5.8e-107) tmp = t_1; elseif (z <= 1.45e-38) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -x / ((z * a) - t); t_2 = (y - (x / z)) / a; t_3 = (x - (y * z)) / t; tmp = 0.0; if (z <= -7.5e-10) tmp = t_2; elseif (z <= -6.3e-261) tmp = t_1; elseif (z <= 1.3e-292) tmp = t_3; elseif (z <= 5.8e-107) tmp = t_1; elseif (z <= 1.45e-38) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-x) / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -7.5e-10], t$95$2, If[LessEqual[z, -6.3e-261], t$95$1, If[LessEqual[z, 1.3e-292], t$95$3, If[LessEqual[z, 5.8e-107], t$95$1, If[LessEqual[z, 1.45e-38], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot a - t}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
t_3 := \frac{x - y \cdot z}{t}\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{-10}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -6.3 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-292}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-38}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -7.49999999999999995e-10 or 1.44999999999999997e-38 < z Initial program 75.4%
sub-neg75.4%
+-commutative75.4%
neg-sub075.4%
associate-+l-75.4%
sub0-neg75.4%
neg-mul-175.4%
sub-neg75.4%
+-commutative75.4%
neg-sub075.4%
associate-+l-75.4%
sub0-neg75.4%
neg-mul-175.4%
times-frac75.4%
metadata-eval75.4%
*-lft-identity75.4%
*-commutative75.4%
Simplified75.4%
div-sub75.4%
associate-/l*83.5%
Applied egg-rr83.5%
Taylor expanded in a around inf 73.9%
if -7.49999999999999995e-10 < z < -6.30000000000000032e-261 or 1.30000000000000007e-292 < z < 5.7999999999999996e-107Initial 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 79.5%
associate-*r/79.5%
neg-mul-179.5%
Simplified79.5%
if -6.30000000000000032e-261 < z < 1.30000000000000007e-292 or 5.7999999999999996e-107 < z < 1.44999999999999997e-38Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 65.0%
*-commutative65.0%
distribute-lft-out--65.0%
associate-/l*74.1%
unpow274.1%
Simplified74.1%
Taylor expanded in y around inf 83.3%
Taylor expanded in t around 0 95.4%
+-commutative95.4%
mul-1-neg95.4%
unsub-neg95.4%
*-commutative95.4%
Simplified95.4%
Final simplification77.7%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -180000000000.0)
(and (not (<= z 2.5e+32)) (or (<= z 2.75e+63) (not (<= z 3.7e+101)))))
(/ y a)
(/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -180000000000.0) || (!(z <= 2.5e+32) && ((z <= 2.75e+63) || !(z <= 3.7e+101)))) {
tmp = y / 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 <= (-180000000000.0d0)) .or. (.not. (z <= 2.5d+32)) .and. (z <= 2.75d+63) .or. (.not. (z <= 3.7d+101))) then
tmp = y / 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 <= -180000000000.0) || (!(z <= 2.5e+32) && ((z <= 2.75e+63) || !(z <= 3.7e+101)))) {
tmp = y / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -180000000000.0) or (not (z <= 2.5e+32) and ((z <= 2.75e+63) or not (z <= 3.7e+101))): tmp = y / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -180000000000.0) || (!(z <= 2.5e+32) && ((z <= 2.75e+63) || !(z <= 3.7e+101)))) tmp = Float64(y / 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 <= -180000000000.0) || (~((z <= 2.5e+32)) && ((z <= 2.75e+63) || ~((z <= 3.7e+101))))) tmp = y / a; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -180000000000.0], And[N[Not[LessEqual[z, 2.5e+32]], $MachinePrecision], Or[LessEqual[z, 2.75e+63], N[Not[LessEqual[z, 3.7e+101]], $MachinePrecision]]]], N[(y / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -180000000000 \lor \neg \left(z \leq 2.5 \cdot 10^{+32}\right) \land \left(z \leq 2.75 \cdot 10^{+63} \lor \neg \left(z \leq 3.7 \cdot 10^{+101}\right)\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.8e11 or 2.4999999999999999e32 < z < 2.75000000000000002e63 or 3.6999999999999997e101 < z Initial program 68.2%
sub-neg68.2%
+-commutative68.2%
neg-sub068.2%
associate-+l-68.2%
sub0-neg68.2%
neg-mul-168.2%
sub-neg68.2%
+-commutative68.2%
neg-sub068.2%
associate-+l-68.2%
sub0-neg68.2%
neg-mul-168.2%
times-frac68.2%
metadata-eval68.2%
*-lft-identity68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in z around inf 69.6%
if -1.8e11 < z < 2.4999999999999999e32 or 2.75000000000000002e63 < z < 3.6999999999999997e101Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 53.9%
*-commutative53.9%
distribute-lft-out--53.9%
associate-/l*56.7%
unpow256.7%
Simplified56.7%
Taylor expanded in y around inf 64.4%
Taylor expanded in t around 0 66.7%
+-commutative66.7%
mul-1-neg66.7%
unsub-neg66.7%
*-commutative66.7%
Simplified66.7%
Final simplification68.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.2e+187) (not (<= z 2.8e+222))) (/ (- y (/ x z)) a) (/ (- x (* y z)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e+187) || !(z <= 2.8e+222)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / (t - (z * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-9.2d+187)) .or. (.not. (z <= 2.8d+222))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (y * z)) / (t - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e+187) || !(z <= 2.8e+222)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e+187) or not (z <= 2.8e+222): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e+187) || !(z <= 2.8e+222)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.2e+187) || ~((z <= 2.8e+222))) tmp = (y - (x / z)) / a; else tmp = (x - (y * z)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.2e+187], N[Not[LessEqual[z, 2.8e+222]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+187} \lor \neg \left(z \leq 2.8 \cdot 10^{+222}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -9.20000000000000015e187 or 2.8000000000000001e222 < z Initial program 48.9%
sub-neg48.9%
+-commutative48.9%
neg-sub048.9%
associate-+l-48.9%
sub0-neg48.9%
neg-mul-148.9%
sub-neg48.9%
+-commutative48.9%
neg-sub048.9%
associate-+l-48.9%
sub0-neg48.9%
neg-mul-148.9%
times-frac48.9%
metadata-eval48.9%
*-lft-identity48.9%
*-commutative48.9%
Simplified48.9%
div-sub48.9%
associate-/l*65.7%
Applied egg-rr65.7%
Taylor expanded in a around inf 91.0%
if -9.20000000000000015e187 < z < 2.8000000000000001e222Initial program 95.6%
Final simplification94.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.5e-69) (not (<= a 9.4e-48))) (- (/ y a) (/ (/ x a) z)) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e-69) || !(a <= 9.4e-48)) {
tmp = (y / a) - ((x / a) / 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 ((a <= (-2.5d-69)) .or. (.not. (a <= 9.4d-48))) then
tmp = (y / a) - ((x / a) / 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 ((a <= -2.5e-69) || !(a <= 9.4e-48)) {
tmp = (y / a) - ((x / a) / z);
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.5e-69) or not (a <= 9.4e-48): tmp = (y / a) - ((x / a) / z) else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.5e-69) || !(a <= 9.4e-48)) tmp = Float64(Float64(y / a) - Float64(Float64(x / a) / 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 ((a <= -2.5e-69) || ~((a <= 9.4e-48))) tmp = (y / a) - ((x / a) / z); else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.5e-69], N[Not[LessEqual[a, 9.4e-48]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-69} \lor \neg \left(a \leq 9.4 \cdot 10^{-48}\right):\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if a < -2.50000000000000017e-69 or 9.3999999999999995e-48 < a Initial program 78.8%
sub-neg78.8%
+-commutative78.8%
neg-sub078.8%
associate-+l-78.8%
sub0-neg78.8%
neg-mul-178.8%
sub-neg78.8%
+-commutative78.8%
neg-sub078.8%
associate-+l-78.8%
sub0-neg78.8%
neg-mul-178.8%
times-frac78.8%
metadata-eval78.8%
*-lft-identity78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in a around inf 39.4%
associate--l+39.4%
associate-/l*47.3%
*-commutative47.3%
unpow247.3%
unpow247.3%
swap-sqr54.4%
unpow254.4%
*-commutative54.4%
*-commutative54.4%
*-commutative54.4%
associate-/r*54.2%
Simplified54.2%
Taylor expanded in t around 0 70.1%
mul-1-neg70.1%
associate-/r*71.7%
distribute-frac-neg71.7%
Simplified71.7%
if -2.50000000000000017e-69 < a < 9.3999999999999995e-48Initial program 96.9%
sub-neg96.9%
+-commutative96.9%
neg-sub096.9%
associate-+l-96.9%
sub0-neg96.9%
neg-mul-196.9%
sub-neg96.9%
+-commutative96.9%
neg-sub096.9%
associate-+l-96.9%
sub0-neg96.9%
neg-mul-196.9%
times-frac96.9%
metadata-eval96.9%
*-lft-identity96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in z around 0 66.1%
*-commutative66.1%
distribute-lft-out--66.1%
associate-/l*64.3%
unpow264.3%
Simplified64.3%
Taylor expanded in y around inf 71.9%
Taylor expanded in t around 0 76.5%
+-commutative76.5%
mul-1-neg76.5%
unsub-neg76.5%
*-commutative76.5%
Simplified76.5%
Final simplification73.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5e-43) (not (<= z 1.05e-39))) (/ (- y (/ x z)) a) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5e-43) || !(z <= 1.05e-39)) {
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 <= (-5d-43)) .or. (.not. (z <= 1.05d-39))) 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 <= -5e-43) || !(z <= 1.05e-39)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5e-43) or not (z <= 1.05e-39): 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 <= -5e-43) || !(z <= 1.05e-39)) 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 <= -5e-43) || ~((z <= 1.05e-39))) 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, -5e-43], N[Not[LessEqual[z, 1.05e-39]], $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 -5 \cdot 10^{-43} \lor \neg \left(z \leq 1.05 \cdot 10^{-39}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -5.00000000000000019e-43 or 1.04999999999999997e-39 < z Initial program 76.0%
sub-neg76.0%
+-commutative76.0%
neg-sub076.0%
associate-+l-76.0%
sub0-neg76.0%
neg-mul-176.0%
sub-neg76.0%
+-commutative76.0%
neg-sub076.0%
associate-+l-76.0%
sub0-neg76.0%
neg-mul-176.0%
times-frac76.0%
metadata-eval76.0%
*-lft-identity76.0%
*-commutative76.0%
Simplified76.0%
div-sub76.0%
associate-/l*84.0%
Applied egg-rr84.0%
Taylor expanded in a around inf 73.9%
if -5.00000000000000019e-43 < z < 1.04999999999999997e-39Initial 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 56.3%
*-commutative56.3%
distribute-lft-out--56.3%
associate-/l*59.2%
unpow259.2%
Simplified59.2%
Taylor expanded in y around inf 68.5%
Taylor expanded in t around 0 71.6%
+-commutative71.6%
mul-1-neg71.6%
unsub-neg71.6%
*-commutative71.6%
Simplified71.6%
Final simplification72.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.15e-24) (/ y a) (if (<= z 0.0036) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e-24) {
tmp = y / a;
} else if (z <= 0.0036) {
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 <= (-1.15d-24)) then
tmp = y / a
else if (z <= 0.0036d0) 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 <= -1.15e-24) {
tmp = y / a;
} else if (z <= 0.0036) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.15e-24: tmp = y / a elif z <= 0.0036: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.15e-24) tmp = Float64(y / a); elseif (z <= 0.0036) 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 <= -1.15e-24) tmp = y / a; elseif (z <= 0.0036) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.15e-24], N[(y / a), $MachinePrecision], If[LessEqual[z, 0.0036], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 0.0036:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.1500000000000001e-24 or 0.0035999999999999999 < z Initial program 74.0%
sub-neg74.0%
+-commutative74.0%
neg-sub074.0%
associate-+l-74.0%
sub0-neg74.0%
neg-mul-174.0%
sub-neg74.0%
+-commutative74.0%
neg-sub074.0%
associate-+l-74.0%
sub0-neg74.0%
neg-mul-174.0%
times-frac74.0%
metadata-eval74.0%
*-lft-identity74.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in z around inf 60.9%
if -1.1500000000000001e-24 < z < 0.0035999999999999999Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 52.9%
Final simplification57.2%
(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 85.9%
sub-neg85.9%
+-commutative85.9%
neg-sub085.9%
associate-+l-85.9%
sub0-neg85.9%
neg-mul-185.9%
sub-neg85.9%
+-commutative85.9%
neg-sub085.9%
associate-+l-85.9%
sub0-neg85.9%
neg-mul-185.9%
times-frac85.9%
metadata-eval85.9%
*-lft-identity85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in z around 0 32.7%
Final simplification32.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
(if (< z -32113435955957344.0)
t_2
(if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (a * z)
t_2 = (x / t_1) - (y / ((t / z) - a))
if (z < (-32113435955957344.0d0)) then
tmp = t_2
else if (z < 3.5139522372978296d-86) then
tmp = (x - (y * z)) * (1.0d0 / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) t_2 = (x / t_1) - (y / ((t / z) - a)) tmp = 0 if z < -32113435955957344.0: tmp = t_2 elif z < 3.5139522372978296e-86: tmp = (x - (y * z)) * (1.0 / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))) tmp = 0.0 if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); t_2 = (x / t_1) - (y / ((t / z) - a)); tmp = 0.0; if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = (x - (y * z)) * (1.0 / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023258
(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))))