
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.65e+69) (not (<= z 2.25e+205))) (/ (- y (/ x z)) a) (/ (- x (* z y)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.65e+69) || !(z <= 2.25e+205)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.65d+69)) .or. (.not. (z <= 2.25d+205))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (z * y)) / (t - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.65e+69) || !(z <= 2.25e+205)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.65e+69) or not (z <= 2.25e+205): tmp = (y - (x / z)) / a else: tmp = (x - (z * y)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.65e+69) || !(z <= 2.25e+205)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.65e+69) || ~((z <= 2.25e+205))) tmp = (y - (x / z)) / a; else tmp = (x - (z * y)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.65e+69], N[Not[LessEqual[z, 2.25e+205]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{+69} \lor \neg \left(z \leq 2.25 \cdot 10^{+205}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -2.65e69 or 2.25000000000000018e205 < z Initial program 62.3%
sub-neg62.3%
+-commutative62.3%
neg-sub062.3%
associate-+l-62.3%
sub0-neg62.3%
neg-mul-162.3%
sub-neg62.3%
+-commutative62.3%
neg-sub062.3%
associate-+l-62.3%
sub0-neg62.3%
neg-mul-162.3%
times-frac62.3%
metadata-eval62.3%
*-lft-identity62.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in a around inf 58.8%
*-commutative58.8%
Simplified58.8%
Taylor expanded in z around 0 87.3%
mul-1-neg87.3%
+-commutative87.3%
unsub-neg87.3%
Simplified87.3%
Taylor expanded in y around 0 87.3%
+-commutative87.3%
associate-*r/87.3%
associate-/l/93.1%
associate-*r/93.1%
mul-1-neg93.1%
distribute-frac-neg93.1%
sub-neg93.1%
div-sub93.1%
Simplified93.1%
if -2.65e69 < z < 2.25000000000000018e205Initial program 94.9%
Final simplification94.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- x) t_1)) (t_3 (/ (- y (/ x z)) a)))
(if (<= z -4.4e-13)
t_3
(if (<= z -3.3e-217)
t_2
(if (<= z 0.000225)
(/ (- x (* z y)) t)
(if (<= z 2.85e+54)
t_2
(if (<= z 5.2e+96)
t_3
(if (<= z 2.7e+126)
t_2
(if (<= z 2.25e+205) (* y (/ z t_1)) t_3)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = -x / t_1;
double t_3 = (y - (x / z)) / a;
double tmp;
if (z <= -4.4e-13) {
tmp = t_3;
} else if (z <= -3.3e-217) {
tmp = t_2;
} else if (z <= 0.000225) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.85e+54) {
tmp = t_2;
} else if (z <= 5.2e+96) {
tmp = t_3;
} else if (z <= 2.7e+126) {
tmp = t_2;
} else if (z <= 2.25e+205) {
tmp = y * (z / t_1);
} else {
tmp = t_3;
}
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 = (z * a) - t
t_2 = -x / t_1
t_3 = (y - (x / z)) / a
if (z <= (-4.4d-13)) then
tmp = t_3
else if (z <= (-3.3d-217)) then
tmp = t_2
else if (z <= 0.000225d0) then
tmp = (x - (z * y)) / t
else if (z <= 2.85d+54) then
tmp = t_2
else if (z <= 5.2d+96) then
tmp = t_3
else if (z <= 2.7d+126) then
tmp = t_2
else if (z <= 2.25d+205) then
tmp = y * (z / t_1)
else
tmp = t_3
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 / t_1;
double t_3 = (y - (x / z)) / a;
double tmp;
if (z <= -4.4e-13) {
tmp = t_3;
} else if (z <= -3.3e-217) {
tmp = t_2;
} else if (z <= 0.000225) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.85e+54) {
tmp = t_2;
} else if (z <= 5.2e+96) {
tmp = t_3;
} else if (z <= 2.7e+126) {
tmp = t_2;
} else if (z <= 2.25e+205) {
tmp = y * (z / t_1);
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = -x / t_1 t_3 = (y - (x / z)) / a tmp = 0 if z <= -4.4e-13: tmp = t_3 elif z <= -3.3e-217: tmp = t_2 elif z <= 0.000225: tmp = (x - (z * y)) / t elif z <= 2.85e+54: tmp = t_2 elif z <= 5.2e+96: tmp = t_3 elif z <= 2.7e+126: tmp = t_2 elif z <= 2.25e+205: tmp = y * (z / t_1) else: tmp = t_3 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(-x) / t_1) t_3 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -4.4e-13) tmp = t_3; elseif (z <= -3.3e-217) tmp = t_2; elseif (z <= 0.000225) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 2.85e+54) tmp = t_2; elseif (z <= 5.2e+96) tmp = t_3; elseif (z <= 2.7e+126) tmp = t_2; elseif (z <= 2.25e+205) tmp = Float64(y * Float64(z / t_1)); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = -x / t_1; t_3 = (y - (x / z)) / a; tmp = 0.0; if (z <= -4.4e-13) tmp = t_3; elseif (z <= -3.3e-217) tmp = t_2; elseif (z <= 0.000225) tmp = (x - (z * y)) / t; elseif (z <= 2.85e+54) tmp = t_2; elseif (z <= 5.2e+96) tmp = t_3; elseif (z <= 2.7e+126) tmp = t_2; elseif (z <= 2.25e+205) tmp = y * (z / t_1); else tmp = t_3; 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[((-x) / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -4.4e-13], t$95$3, If[LessEqual[z, -3.3e-217], t$95$2, If[LessEqual[z, 0.000225], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.85e+54], t$95$2, If[LessEqual[z, 5.2e+96], t$95$3, If[LessEqual[z, 2.7e+126], t$95$2, If[LessEqual[z, 2.25e+205], N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{-x}{t_1}\\
t_3 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{-13}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-217}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 0.000225:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{+54}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+96}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+205}:\\
\;\;\;\;y \cdot \frac{z}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -4.39999999999999993e-13 or 2.8499999999999998e54 < z < 5.2e96 or 2.25000000000000018e205 < z Initial program 65.3%
sub-neg65.3%
+-commutative65.3%
neg-sub065.3%
associate-+l-65.3%
sub0-neg65.3%
neg-mul-165.3%
sub-neg65.3%
+-commutative65.3%
neg-sub065.3%
associate-+l-65.3%
sub0-neg65.3%
neg-mul-165.3%
times-frac65.3%
metadata-eval65.3%
*-lft-identity65.3%
*-commutative65.3%
Simplified65.3%
Taylor expanded in a around inf 55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in z around 0 82.5%
mul-1-neg82.5%
+-commutative82.5%
unsub-neg82.5%
Simplified82.5%
Taylor expanded in y around 0 82.5%
+-commutative82.5%
associate-*r/82.5%
associate-/l/87.0%
associate-*r/87.0%
mul-1-neg87.0%
distribute-frac-neg87.0%
sub-neg87.0%
div-sub87.0%
Simplified87.0%
if -4.39999999999999993e-13 < z < -3.29999999999999993e-217 or 2.2499999999999999e-4 < z < 2.8499999999999998e54 or 5.2e96 < z < 2.70000000000000002e126Initial program 98.3%
sub-neg98.3%
+-commutative98.3%
neg-sub098.3%
associate-+l-98.3%
sub0-neg98.3%
neg-mul-198.3%
sub-neg98.3%
+-commutative98.3%
neg-sub098.3%
associate-+l-98.3%
sub0-neg98.3%
neg-mul-198.3%
times-frac98.3%
metadata-eval98.3%
*-lft-identity98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in y around 0 76.2%
neg-mul-176.2%
Simplified76.2%
if -3.29999999999999993e-217 < z < 2.2499999999999999e-4Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in a around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
neg-sub082.1%
sub-neg82.1%
+-commutative82.1%
associate--r+82.1%
neg-sub082.1%
remove-double-neg82.1%
*-commutative82.1%
Simplified82.1%
if 2.70000000000000002e126 < z < 2.25000000000000018e205Initial program 85.2%
sub-neg85.2%
+-commutative85.2%
neg-sub085.2%
associate-+l-85.2%
sub0-neg85.2%
neg-mul-185.2%
sub-neg85.2%
+-commutative85.2%
neg-sub085.2%
associate-+l-85.2%
sub0-neg85.2%
neg-mul-185.2%
times-frac85.2%
metadata-eval85.2%
*-lft-identity85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y around inf 70.3%
*-commutative70.3%
associate-*r/77.3%
*-commutative77.3%
Simplified77.3%
Final simplification82.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- x) t_1)) (t_3 (/ (- y (/ x z)) a)))
(if (<= z -4.6e-12)
t_3
(if (<= z -1.9e-217)
t_2
(if (<= z 0.000122)
(/ (- x (* z y)) t)
(if (<= z 2.55e+54)
t_2
(if (<= z 5.2e+96)
t_3
(if (<= z 2.3e+126)
t_2
(if (<= z 1.4e+208) (/ y (/ t_1 z)) t_3)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = -x / t_1;
double t_3 = (y - (x / z)) / a;
double tmp;
if (z <= -4.6e-12) {
tmp = t_3;
} else if (z <= -1.9e-217) {
tmp = t_2;
} else if (z <= 0.000122) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.55e+54) {
tmp = t_2;
} else if (z <= 5.2e+96) {
tmp = t_3;
} else if (z <= 2.3e+126) {
tmp = t_2;
} else if (z <= 1.4e+208) {
tmp = y / (t_1 / z);
} else {
tmp = t_3;
}
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 = (z * a) - t
t_2 = -x / t_1
t_3 = (y - (x / z)) / a
if (z <= (-4.6d-12)) then
tmp = t_3
else if (z <= (-1.9d-217)) then
tmp = t_2
else if (z <= 0.000122d0) then
tmp = (x - (z * y)) / t
else if (z <= 2.55d+54) then
tmp = t_2
else if (z <= 5.2d+96) then
tmp = t_3
else if (z <= 2.3d+126) then
tmp = t_2
else if (z <= 1.4d+208) then
tmp = y / (t_1 / z)
else
tmp = t_3
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 / t_1;
double t_3 = (y - (x / z)) / a;
double tmp;
if (z <= -4.6e-12) {
tmp = t_3;
} else if (z <= -1.9e-217) {
tmp = t_2;
} else if (z <= 0.000122) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.55e+54) {
tmp = t_2;
} else if (z <= 5.2e+96) {
tmp = t_3;
} else if (z <= 2.3e+126) {
tmp = t_2;
} else if (z <= 1.4e+208) {
tmp = y / (t_1 / z);
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = -x / t_1 t_3 = (y - (x / z)) / a tmp = 0 if z <= -4.6e-12: tmp = t_3 elif z <= -1.9e-217: tmp = t_2 elif z <= 0.000122: tmp = (x - (z * y)) / t elif z <= 2.55e+54: tmp = t_2 elif z <= 5.2e+96: tmp = t_3 elif z <= 2.3e+126: tmp = t_2 elif z <= 1.4e+208: tmp = y / (t_1 / z) else: tmp = t_3 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(-x) / t_1) t_3 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -4.6e-12) tmp = t_3; elseif (z <= -1.9e-217) tmp = t_2; elseif (z <= 0.000122) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 2.55e+54) tmp = t_2; elseif (z <= 5.2e+96) tmp = t_3; elseif (z <= 2.3e+126) tmp = t_2; elseif (z <= 1.4e+208) tmp = Float64(y / Float64(t_1 / z)); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = -x / t_1; t_3 = (y - (x / z)) / a; tmp = 0.0; if (z <= -4.6e-12) tmp = t_3; elseif (z <= -1.9e-217) tmp = t_2; elseif (z <= 0.000122) tmp = (x - (z * y)) / t; elseif (z <= 2.55e+54) tmp = t_2; elseif (z <= 5.2e+96) tmp = t_3; elseif (z <= 2.3e+126) tmp = t_2; elseif (z <= 1.4e+208) tmp = y / (t_1 / z); else tmp = t_3; 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[((-x) / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -4.6e-12], t$95$3, If[LessEqual[z, -1.9e-217], t$95$2, If[LessEqual[z, 0.000122], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.55e+54], t$95$2, If[LessEqual[z, 5.2e+96], t$95$3, If[LessEqual[z, 2.3e+126], t$95$2, If[LessEqual[z, 1.4e+208], N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{-x}{t_1}\\
t_3 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{-12}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-217}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 0.000122:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+54}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+96}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+208}:\\
\;\;\;\;\frac{y}{\frac{t_1}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -4.59999999999999979e-12 or 2.55000000000000005e54 < z < 5.2e96 or 1.40000000000000011e208 < z Initial program 65.3%
sub-neg65.3%
+-commutative65.3%
neg-sub065.3%
associate-+l-65.3%
sub0-neg65.3%
neg-mul-165.3%
sub-neg65.3%
+-commutative65.3%
neg-sub065.3%
associate-+l-65.3%
sub0-neg65.3%
neg-mul-165.3%
times-frac65.3%
metadata-eval65.3%
*-lft-identity65.3%
*-commutative65.3%
Simplified65.3%
Taylor expanded in a around inf 55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in z around 0 82.5%
mul-1-neg82.5%
+-commutative82.5%
unsub-neg82.5%
Simplified82.5%
Taylor expanded in y around 0 82.5%
+-commutative82.5%
associate-*r/82.5%
associate-/l/87.0%
associate-*r/87.0%
mul-1-neg87.0%
distribute-frac-neg87.0%
sub-neg87.0%
div-sub87.0%
Simplified87.0%
if -4.59999999999999979e-12 < z < -1.89999999999999993e-217 or 1.21999999999999997e-4 < z < 2.55000000000000005e54 or 5.2e96 < z < 2.3000000000000001e126Initial program 98.3%
sub-neg98.3%
+-commutative98.3%
neg-sub098.3%
associate-+l-98.3%
sub0-neg98.3%
neg-mul-198.3%
sub-neg98.3%
+-commutative98.3%
neg-sub098.3%
associate-+l-98.3%
sub0-neg98.3%
neg-mul-198.3%
times-frac98.3%
metadata-eval98.3%
*-lft-identity98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in y around 0 76.2%
neg-mul-176.2%
Simplified76.2%
if -1.89999999999999993e-217 < z < 1.21999999999999997e-4Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in a around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
neg-sub082.1%
sub-neg82.1%
+-commutative82.1%
associate--r+82.1%
neg-sub082.1%
remove-double-neg82.1%
*-commutative82.1%
Simplified82.1%
if 2.3000000000000001e126 < z < 1.40000000000000011e208Initial program 85.2%
sub-neg85.2%
+-commutative85.2%
neg-sub085.2%
associate-+l-85.2%
sub0-neg85.2%
neg-mul-185.2%
sub-neg85.2%
+-commutative85.2%
neg-sub085.2%
associate-+l-85.2%
sub0-neg85.2%
neg-mul-185.2%
times-frac85.2%
metadata-eval85.2%
*-lft-identity85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y around inf 70.3%
associate-/l*77.6%
Simplified77.6%
Final simplification82.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x) (- (* z a) t))) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -1.38e-11)
t_2
(if (<= z -5.2e-217)
t_1
(if (<= z 0.0128) (/ (- x (* z y)) t) (if (<= z 2.8e+53) t_1 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 tmp;
if (z <= -1.38e-11) {
tmp = t_2;
} else if (z <= -5.2e-217) {
tmp = t_1;
} else if (z <= 0.0128) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.8e+53) {
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 * a) - t)
t_2 = (y - (x / z)) / a
if (z <= (-1.38d-11)) then
tmp = t_2
else if (z <= (-5.2d-217)) then
tmp = t_1
else if (z <= 0.0128d0) then
tmp = (x - (z * y)) / t
else if (z <= 2.8d+53) 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 * a) - t);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.38e-11) {
tmp = t_2;
} else if (z <= -5.2e-217) {
tmp = t_1;
} else if (z <= 0.0128) {
tmp = (x - (z * y)) / t;
} else if (z <= 2.8e+53) {
tmp = t_1;
} 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 tmp = 0 if z <= -1.38e-11: tmp = t_2 elif z <= -5.2e-217: tmp = t_1 elif z <= 0.0128: tmp = (x - (z * y)) / t elif z <= 2.8e+53: tmp = t_1 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) tmp = 0.0 if (z <= -1.38e-11) tmp = t_2; elseif (z <= -5.2e-217) tmp = t_1; elseif (z <= 0.0128) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 2.8e+53) tmp = t_1; 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; tmp = 0.0; if (z <= -1.38e-11) tmp = t_2; elseif (z <= -5.2e-217) tmp = t_1; elseif (z <= 0.0128) tmp = (x - (z * y)) / t; elseif (z <= 2.8e+53) tmp = t_1; 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]}, If[LessEqual[z, -1.38e-11], t$95$2, If[LessEqual[z, -5.2e-217], t$95$1, If[LessEqual[z, 0.0128], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.8e+53], t$95$1, 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}\\
\mathbf{if}\;z \leq -1.38 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-217}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.0128:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.38e-11 or 2.8e53 < z Initial program 68.8%
sub-neg68.8%
+-commutative68.8%
neg-sub068.8%
associate-+l-68.8%
sub0-neg68.8%
neg-mul-168.8%
sub-neg68.8%
+-commutative68.8%
neg-sub068.8%
associate-+l-68.8%
sub0-neg68.8%
neg-mul-168.8%
times-frac68.8%
metadata-eval68.8%
*-lft-identity68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in a around inf 53.8%
*-commutative53.8%
Simplified53.8%
Taylor expanded in z around 0 78.0%
mul-1-neg78.0%
+-commutative78.0%
unsub-neg78.0%
Simplified78.0%
Taylor expanded in y around 0 78.0%
+-commutative78.0%
associate-*r/78.0%
associate-/l/82.6%
associate-*r/82.6%
mul-1-neg82.6%
distribute-frac-neg82.6%
sub-neg82.6%
div-sub82.6%
Simplified82.6%
if -1.38e-11 < z < -5.19999999999999986e-217 or 0.0128000000000000006 < z < 2.8e53Initial program 98.1%
sub-neg98.1%
+-commutative98.1%
neg-sub098.1%
associate-+l-98.1%
sub0-neg98.1%
neg-mul-198.1%
sub-neg98.1%
+-commutative98.1%
neg-sub098.1%
associate-+l-98.1%
sub0-neg98.1%
neg-mul-198.1%
times-frac98.1%
metadata-eval98.1%
*-lft-identity98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in y around 0 74.1%
neg-mul-174.1%
Simplified74.1%
if -5.19999999999999986e-217 < z < 0.0128000000000000006Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in a around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
neg-sub082.1%
sub-neg82.1%
+-commutative82.1%
associate--r+82.1%
neg-sub082.1%
remove-double-neg82.1%
*-commutative82.1%
Simplified82.1%
Final simplification80.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.05e-13)
(/ y a)
(if (<= z 2.8e-24)
(/ x t)
(if (<= z 4.8e+23)
(/ (- x) (* z a))
(if (<= z 3.8e+57) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-13) {
tmp = y / a;
} else if (z <= 2.8e-24) {
tmp = x / t;
} else if (z <= 4.8e+23) {
tmp = -x / (z * a);
} else if (z <= 3.8e+57) {
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.05d-13)) then
tmp = y / a
else if (z <= 2.8d-24) then
tmp = x / t
else if (z <= 4.8d+23) then
tmp = -x / (z * a)
else if (z <= 3.8d+57) 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.05e-13) {
tmp = y / a;
} else if (z <= 2.8e-24) {
tmp = x / t;
} else if (z <= 4.8e+23) {
tmp = -x / (z * a);
} else if (z <= 3.8e+57) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e-13: tmp = y / a elif z <= 2.8e-24: tmp = x / t elif z <= 4.8e+23: tmp = -x / (z * a) elif z <= 3.8e+57: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e-13) tmp = Float64(y / a); elseif (z <= 2.8e-24) tmp = Float64(x / t); elseif (z <= 4.8e+23) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 3.8e+57) 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.05e-13) tmp = y / a; elseif (z <= 2.8e-24) tmp = x / t; elseif (z <= 4.8e+23) tmp = -x / (z * a); elseif (z <= 3.8e+57) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e-13], N[(y / a), $MachinePrecision], If[LessEqual[z, 2.8e-24], N[(x / t), $MachinePrecision], If[LessEqual[z, 4.8e+23], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+57], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-13}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+23}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+57}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.04999999999999994e-13 or 3.7999999999999999e57 < z Initial program 68.8%
sub-neg68.8%
+-commutative68.8%
neg-sub068.8%
associate-+l-68.8%
sub0-neg68.8%
neg-mul-168.8%
sub-neg68.8%
+-commutative68.8%
neg-sub068.8%
associate-+l-68.8%
sub0-neg68.8%
neg-mul-168.8%
times-frac68.8%
metadata-eval68.8%
*-lft-identity68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in z around inf 67.8%
if -1.04999999999999994e-13 < z < 2.8000000000000002e-24 or 4.8e23 < z < 3.7999999999999999e57Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
times-frac99.1%
metadata-eval99.1%
*-lft-identity99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in z around 0 59.2%
if 2.8000000000000002e-24 < z < 4.8e23Initial 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 a around inf 54.5%
*-commutative54.5%
Simplified54.5%
Taylor expanded in z around 0 55.9%
associate-*r/55.9%
neg-mul-155.9%
Simplified55.9%
Final simplification63.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.8e-13)
(/ y a)
(if (<= z 3.6e-25)
(/ x t)
(if (<= z 6.6e+23)
(/ (/ x (- a)) z)
(if (<= z 6.4e+60) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e-13) {
tmp = y / a;
} else if (z <= 3.6e-25) {
tmp = x / t;
} else if (z <= 6.6e+23) {
tmp = (x / -a) / z;
} else if (z <= 6.4e+60) {
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 <= (-3.8d-13)) then
tmp = y / a
else if (z <= 3.6d-25) then
tmp = x / t
else if (z <= 6.6d+23) then
tmp = (x / -a) / z
else if (z <= 6.4d+60) 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 <= -3.8e-13) {
tmp = y / a;
} else if (z <= 3.6e-25) {
tmp = x / t;
} else if (z <= 6.6e+23) {
tmp = (x / -a) / z;
} else if (z <= 6.4e+60) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.8e-13: tmp = y / a elif z <= 3.6e-25: tmp = x / t elif z <= 6.6e+23: tmp = (x / -a) / z elif z <= 6.4e+60: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e-13) tmp = Float64(y / a); elseif (z <= 3.6e-25) tmp = Float64(x / t); elseif (z <= 6.6e+23) tmp = Float64(Float64(x / Float64(-a)) / z); elseif (z <= 6.4e+60) 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 <= -3.8e-13) tmp = y / a; elseif (z <= 3.6e-25) tmp = x / t; elseif (z <= 6.6e+23) tmp = (x / -a) / z; elseif (z <= 6.4e+60) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e-13], N[(y / a), $MachinePrecision], If[LessEqual[z, 3.6e-25], N[(x / t), $MachinePrecision], If[LessEqual[z, 6.6e+23], N[(N[(x / (-a)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 6.4e+60], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-13}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+23}:\\
\;\;\;\;\frac{\frac{x}{-a}}{z}\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+60}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.8e-13 or 6.39999999999999982e60 < z Initial program 68.8%
sub-neg68.8%
+-commutative68.8%
neg-sub068.8%
associate-+l-68.8%
sub0-neg68.8%
neg-mul-168.8%
sub-neg68.8%
+-commutative68.8%
neg-sub068.8%
associate-+l-68.8%
sub0-neg68.8%
neg-mul-168.8%
times-frac68.8%
metadata-eval68.8%
*-lft-identity68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in z around inf 67.8%
if -3.8e-13 < z < 3.5999999999999999e-25 or 6.60000000000000059e23 < z < 6.39999999999999982e60Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
times-frac99.1%
metadata-eval99.1%
*-lft-identity99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in z around 0 59.2%
if 3.5999999999999999e-25 < z < 6.60000000000000059e23Initial 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 a around inf 54.5%
*-commutative54.5%
Simplified54.5%
Taylor expanded in z around 0 54.5%
mul-1-neg54.5%
+-commutative54.5%
unsub-neg54.5%
Simplified54.5%
Taylor expanded in y around 0 54.5%
+-commutative54.5%
associate-*r/54.5%
associate-/l/54.6%
associate-*r/54.6%
mul-1-neg54.6%
distribute-frac-neg54.6%
sub-neg54.6%
div-sub54.6%
Simplified54.6%
Taylor expanded in y around 0 55.9%
associate-/l/56.0%
metadata-eval56.0%
times-frac56.0%
*-commutative56.0%
*-rgt-identity56.0%
neg-mul-156.0%
associate-/l/55.9%
associate-/r*56.0%
Simplified56.0%
Final simplification63.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1620.0) (not (<= z 6.5e+68))) (/ y a) (/ (- x (* z y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1620.0) || !(z <= 6.5e+68)) {
tmp = y / a;
} else {
tmp = (x - (z * y)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1620.0d0)) .or. (.not. (z <= 6.5d+68))) then
tmp = y / a
else
tmp = (x - (z * y)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1620.0) || !(z <= 6.5e+68)) {
tmp = y / a;
} else {
tmp = (x - (z * y)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1620.0) or not (z <= 6.5e+68): tmp = y / a else: tmp = (x - (z * y)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1620.0) || !(z <= 6.5e+68)) tmp = Float64(y / a); else tmp = Float64(Float64(x - Float64(z * y)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1620.0) || ~((z <= 6.5e+68))) tmp = y / a; else tmp = (x - (z * y)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1620.0], N[Not[LessEqual[z, 6.5e+68]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1620 \lor \neg \left(z \leq 6.5 \cdot 10^{+68}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\end{array}
\end{array}
if z < -1620 or 6.5000000000000005e68 < z Initial program 68.0%
sub-neg68.0%
+-commutative68.0%
neg-sub068.0%
associate-+l-68.0%
sub0-neg68.0%
neg-mul-168.0%
sub-neg68.0%
+-commutative68.0%
neg-sub068.0%
associate-+l-68.0%
sub0-neg68.0%
neg-mul-168.0%
times-frac68.0%
metadata-eval68.0%
*-lft-identity68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in z around inf 68.6%
if -1620 < z < 6.5000000000000005e68Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
times-frac99.1%
metadata-eval99.1%
*-lft-identity99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in a around 0 73.1%
associate-*r/73.1%
neg-mul-173.1%
neg-sub073.1%
sub-neg73.1%
+-commutative73.1%
associate--r+73.1%
neg-sub073.1%
remove-double-neg73.1%
*-commutative73.1%
Simplified73.1%
Final simplification71.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.0033) (not (<= z 0.017))) (/ (- y (/ x z)) a) (/ (- x (* z y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.0033) || !(z <= 0.017)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-0.0033d0)) .or. (.not. (z <= 0.017d0))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (z * y)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.0033) || !(z <= 0.017)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.0033) or not (z <= 0.017): tmp = (y - (x / z)) / a else: tmp = (x - (z * y)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.0033) || !(z <= 0.017)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -0.0033) || ~((z <= 0.017))) tmp = (y - (x / z)) / a; else tmp = (x - (z * y)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.0033], N[Not[LessEqual[z, 0.017]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0033 \lor \neg \left(z \leq 0.017\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\end{array}
\end{array}
if z < -0.0033 or 0.017000000000000001 < 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%
Taylor expanded in a around inf 54.0%
*-commutative54.0%
Simplified54.0%
Taylor expanded in z around 0 75.8%
mul-1-neg75.8%
+-commutative75.8%
unsub-neg75.8%
Simplified75.8%
Taylor expanded in y around 0 75.8%
+-commutative75.8%
associate-*r/75.8%
associate-/l/80.7%
associate-*r/80.7%
mul-1-neg80.7%
distribute-frac-neg80.7%
sub-neg80.7%
div-sub80.7%
Simplified80.7%
if -0.0033 < z < 0.017000000000000001Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in a around 0 75.3%
associate-*r/75.3%
neg-mul-175.3%
neg-sub075.3%
sub-neg75.3%
+-commutative75.3%
associate--r+75.3%
neg-sub075.3%
remove-double-neg75.3%
*-commutative75.3%
Simplified75.3%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -6e-12) (/ y a) (if (<= z 2.7e+53) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e-12) {
tmp = y / a;
} else if (z <= 2.7e+53) {
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 <= (-6d-12)) then
tmp = y / a
else if (z <= 2.7d+53) 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 <= -6e-12) {
tmp = y / a;
} else if (z <= 2.7e+53) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e-12: tmp = y / a elif z <= 2.7e+53: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e-12) tmp = Float64(y / a); elseif (z <= 2.7e+53) 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 <= -6e-12) tmp = y / a; elseif (z <= 2.7e+53) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e-12], N[(y / a), $MachinePrecision], If[LessEqual[z, 2.7e+53], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-12}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+53}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.0000000000000003e-12 or 2.70000000000000019e53 < z Initial program 68.8%
sub-neg68.8%
+-commutative68.8%
neg-sub068.8%
associate-+l-68.8%
sub0-neg68.8%
neg-mul-168.8%
sub-neg68.8%
+-commutative68.8%
neg-sub068.8%
associate-+l-68.8%
sub0-neg68.8%
neg-mul-168.8%
times-frac68.8%
metadata-eval68.8%
*-lft-identity68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in z around inf 67.8%
if -6.0000000000000003e-12 < z < 2.70000000000000019e53Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
times-frac99.1%
metadata-eval99.1%
*-lft-identity99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in z around 0 55.2%
Final simplification61.3%
(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 84.4%
sub-neg84.4%
+-commutative84.4%
neg-sub084.4%
associate-+l-84.4%
sub0-neg84.4%
neg-mul-184.4%
sub-neg84.4%
+-commutative84.4%
neg-sub084.4%
associate-+l-84.4%
sub0-neg84.4%
neg-mul-184.4%
times-frac84.4%
metadata-eval84.4%
*-lft-identity84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in z around 0 34.2%
Final simplification34.2%
(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 2023187
(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))))