
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - 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 + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - 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 + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.9e-50) (not (<= a 7.2e-191))) (+ (* y (+ (/ (- t z) (- a t)) 1.0)) x) (- x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.9e-50) || !(a <= 7.2e-191)) {
tmp = (y * (((t - z) / (a - t)) + 1.0)) + x;
} else {
tmp = x - (z * (y / (a - 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.9d-50)) .or. (.not. (a <= 7.2d-191))) then
tmp = (y * (((t - z) / (a - t)) + 1.0d0)) + x
else
tmp = x - (z * (y / (a - 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.9e-50) || !(a <= 7.2e-191)) {
tmp = (y * (((t - z) / (a - t)) + 1.0)) + x;
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.9e-50) or not (a <= 7.2e-191): tmp = (y * (((t - z) / (a - t)) + 1.0)) + x else: tmp = x - (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.9e-50) || !(a <= 7.2e-191)) tmp = Float64(Float64(y * Float64(Float64(Float64(t - z) / Float64(a - t)) + 1.0)) + x); else tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.9e-50) || ~((a <= 7.2e-191))) tmp = (y * (((t - z) / (a - t)) + 1.0)) + x; else tmp = x - (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.9e-50], N[Not[LessEqual[a, 7.2e-191]], $MachinePrecision]], N[(N[(y * N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{-50} \lor \neg \left(a \leq 7.2 \cdot 10^{-191}\right):\\
\;\;\;\;y \cdot \left(\frac{t - z}{a - t} + 1\right) + x\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if a < -2.90000000000000008e-50 or 7.20000000000000038e-191 < a Initial program 81.9%
sub-neg81.9%
distribute-frac-neg81.9%
distribute-rgt-neg-out81.9%
associate-/l*91.0%
div-sub91.0%
associate-+r-91.0%
associate-/r/91.5%
distribute-rgt-neg-out91.5%
associate-/r/91.0%
distribute-frac-neg91.0%
associate-+l+91.0%
associate-+r-91.5%
distribute-frac-neg91.5%
Simplified91.5%
Taylor expanded in y around 0 94.7%
+-commutative94.7%
associate--l+92.9%
div-sub92.8%
Simplified92.8%
if -2.90000000000000008e-50 < a < 7.20000000000000038e-191Initial program 72.3%
sub-neg72.3%
distribute-frac-neg72.3%
distribute-rgt-neg-out72.3%
associate-/l*80.2%
div-sub78.8%
associate-+r-78.8%
associate-/r/80.2%
distribute-rgt-neg-out80.2%
associate-/r/78.8%
distribute-frac-neg78.8%
associate-+l+78.8%
associate-+r-86.4%
distribute-frac-neg86.4%
Simplified87.8%
Taylor expanded in y around 0 90.6%
+-commutative90.6%
associate--l+82.5%
div-sub82.5%
Simplified82.5%
add-cube-cbrt82.2%
pow382.3%
Applied egg-rr82.3%
Taylor expanded in z around inf 95.9%
mul-1-neg95.9%
associate-/l*90.7%
distribute-frac-neg90.7%
associate-/r/97.4%
Simplified97.4%
Final simplification94.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (- (/ y (/ a z)) y))))
(if (<= a -3.8e-16)
t_1
(if (<= a -4.7e-296)
(- x (/ (* y z) (- a t)))
(if (<= a 1e-44) (- x (/ y (/ t (- a z)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((y / (a / z)) - y);
double tmp;
if (a <= -3.8e-16) {
tmp = t_1;
} else if (a <= -4.7e-296) {
tmp = x - ((y * z) / (a - t));
} else if (a <= 1e-44) {
tmp = x - (y / (t / (a - z)));
} 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) :: tmp
t_1 = x - ((y / (a / z)) - y)
if (a <= (-3.8d-16)) then
tmp = t_1
else if (a <= (-4.7d-296)) then
tmp = x - ((y * z) / (a - t))
else if (a <= 1d-44) then
tmp = x - (y / (t / (a - z)))
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 = x - ((y / (a / z)) - y);
double tmp;
if (a <= -3.8e-16) {
tmp = t_1;
} else if (a <= -4.7e-296) {
tmp = x - ((y * z) / (a - t));
} else if (a <= 1e-44) {
tmp = x - (y / (t / (a - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((y / (a / z)) - y) tmp = 0 if a <= -3.8e-16: tmp = t_1 elif a <= -4.7e-296: tmp = x - ((y * z) / (a - t)) elif a <= 1e-44: tmp = x - (y / (t / (a - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(y / Float64(a / z)) - y)) tmp = 0.0 if (a <= -3.8e-16) tmp = t_1; elseif (a <= -4.7e-296) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); elseif (a <= 1e-44) tmp = Float64(x - Float64(y / Float64(t / Float64(a - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((y / (a / z)) - y); tmp = 0.0; if (a <= -3.8e-16) tmp = t_1; elseif (a <= -4.7e-296) tmp = x - ((y * z) / (a - t)); elseif (a <= 1e-44) tmp = x - (y / (t / (a - z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.8e-16], t$95$1, If[LessEqual[a, -4.7e-296], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1e-44], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \left(\frac{y}{\frac{a}{z}} - y\right)\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -4.7 \cdot 10^{-296}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{elif}\;a \leq 10^{-44}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -3.80000000000000012e-16 or 9.99999999999999953e-45 < a Initial program 84.2%
sub-neg84.2%
distribute-frac-neg84.2%
distribute-rgt-neg-out84.2%
associate-/l*93.2%
div-sub93.2%
associate-+r-93.2%
associate-/r/93.7%
distribute-rgt-neg-out93.7%
associate-/r/93.2%
distribute-frac-neg93.2%
associate-+l+93.2%
associate-+r-93.9%
distribute-frac-neg93.9%
Simplified93.9%
Taylor expanded in t around 0 83.0%
associate-/l*87.8%
Simplified87.8%
if -3.80000000000000012e-16 < a < -4.7e-296Initial program 67.3%
sub-neg67.3%
distribute-frac-neg67.3%
distribute-rgt-neg-out67.3%
associate-/l*74.6%
div-sub72.5%
associate-+r-72.5%
associate-/r/74.8%
distribute-rgt-neg-out74.8%
associate-/r/72.5%
distribute-frac-neg72.5%
associate-+l+72.5%
associate-+r-80.0%
distribute-frac-neg80.0%
Simplified82.1%
Taylor expanded in z around inf 92.0%
associate-*r/92.0%
associate-*r*92.0%
neg-mul-192.0%
Simplified92.0%
if -4.7e-296 < a < 9.99999999999999953e-45Initial program 77.1%
sub-neg77.1%
distribute-frac-neg77.1%
distribute-rgt-neg-out77.1%
associate-/l*86.3%
div-sub86.3%
associate-+r-86.3%
associate-/r/86.3%
distribute-rgt-neg-out86.3%
associate-/r/86.3%
distribute-frac-neg86.3%
associate-+l+86.3%
associate-+r-89.1%
distribute-frac-neg89.1%
Simplified89.1%
Taylor expanded in y around 0 96.5%
+-commutative96.5%
associate--l+91.8%
div-sub91.8%
Simplified91.8%
Taylor expanded in t around inf 90.1%
mul-1-neg90.1%
unsub-neg90.1%
associate-/l*94.7%
mul-1-neg94.7%
unsub-neg94.7%
Simplified94.7%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.8e-17) (not (<= a 8.2e-191))) (- (+ y x) (* y (/ z (- a t)))) (- x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.8e-17) || !(a <= 8.2e-191)) {
tmp = (y + x) - (y * (z / (a - t)));
} else {
tmp = x - (z * (y / (a - 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.8d-17)) .or. (.not. (a <= 8.2d-191))) then
tmp = (y + x) - (y * (z / (a - t)))
else
tmp = x - (z * (y / (a - 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.8e-17) || !(a <= 8.2e-191)) {
tmp = (y + x) - (y * (z / (a - t)));
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.8e-17) or not (a <= 8.2e-191): tmp = (y + x) - (y * (z / (a - t))) else: tmp = x - (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.8e-17) || !(a <= 8.2e-191)) tmp = Float64(Float64(y + x) - Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.8e-17) || ~((a <= 8.2e-191))) tmp = (y + x) - (y * (z / (a - t))); else tmp = x - (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.8e-17], N[Not[LessEqual[a, 8.2e-191]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-17} \lor \neg \left(a \leq 8.2 \cdot 10^{-191}\right):\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if a < -1.79999999999999997e-17 or 8.2000000000000004e-191 < a Initial program 81.9%
associate-*l/92.4%
Simplified92.4%
Taylor expanded in z around inf 89.3%
if -1.79999999999999997e-17 < a < 8.2000000000000004e-191Initial program 73.4%
sub-neg73.4%
distribute-frac-neg73.4%
distribute-rgt-neg-out73.4%
associate-/l*80.3%
div-sub79.0%
associate-+r-79.0%
associate-/r/80.3%
distribute-rgt-neg-out80.3%
associate-/r/79.0%
distribute-frac-neg79.0%
associate-+l+79.0%
associate-+r-85.7%
distribute-frac-neg85.7%
Simplified86.9%
Taylor expanded in y around 0 89.5%
+-commutative89.5%
associate--l+82.3%
div-sub82.3%
Simplified82.3%
add-cube-cbrt82.1%
pow382.1%
Applied egg-rr82.1%
Taylor expanded in z around inf 94.1%
mul-1-neg94.1%
associate-/l*89.3%
distribute-frac-neg89.3%
associate-/r/95.3%
Simplified95.3%
Final simplification91.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5.6e-16)
(- x (- (/ y (/ a z)) y))
(if (<= a 1.15e+22)
(- x (* z (/ y (- a t))))
(+ x (* y (+ (/ t (- a t)) 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.6e-16) {
tmp = x - ((y / (a / z)) - y);
} else if (a <= 1.15e+22) {
tmp = x - (z * (y / (a - t)));
} else {
tmp = x + (y * ((t / (a - t)) + 1.0));
}
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 <= (-5.6d-16)) then
tmp = x - ((y / (a / z)) - y)
else if (a <= 1.15d+22) then
tmp = x - (z * (y / (a - t)))
else
tmp = x + (y * ((t / (a - t)) + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.6e-16) {
tmp = x - ((y / (a / z)) - y);
} else if (a <= 1.15e+22) {
tmp = x - (z * (y / (a - t)));
} else {
tmp = x + (y * ((t / (a - t)) + 1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.6e-16: tmp = x - ((y / (a / z)) - y) elif a <= 1.15e+22: tmp = x - (z * (y / (a - t))) else: tmp = x + (y * ((t / (a - t)) + 1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.6e-16) tmp = Float64(x - Float64(Float64(y / Float64(a / z)) - y)); elseif (a <= 1.15e+22) tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y * Float64(Float64(t / Float64(a - t)) + 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.6e-16) tmp = x - ((y / (a / z)) - y); elseif (a <= 1.15e+22) tmp = x - (z * (y / (a - t))); else tmp = x + (y * ((t / (a - t)) + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.6e-16], N[(x - N[(N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e+22], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{-16}:\\
\;\;\;\;x - \left(\frac{y}{\frac{a}{z}} - y\right)\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+22}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(\frac{t}{a - t} + 1\right)\\
\end{array}
\end{array}
if a < -5.6000000000000003e-16Initial program 85.8%
sub-neg85.8%
distribute-frac-neg85.8%
distribute-rgt-neg-out85.8%
associate-/l*95.3%
div-sub95.3%
associate-+r-95.3%
associate-/r/96.0%
distribute-rgt-neg-out96.0%
associate-/r/95.3%
distribute-frac-neg95.3%
associate-+l+95.4%
associate-+r-96.7%
distribute-frac-neg96.7%
Simplified96.7%
Taylor expanded in t around 0 85.4%
associate-/l*91.1%
Simplified91.1%
if -5.6000000000000003e-16 < a < 1.1500000000000001e22Initial program 74.2%
sub-neg74.2%
distribute-frac-neg74.2%
distribute-rgt-neg-out74.2%
associate-/l*81.7%
div-sub80.9%
associate-+r-80.9%
associate-/r/81.8%
distribute-rgt-neg-out81.8%
associate-/r/80.9%
distribute-frac-neg80.9%
associate-+l+80.9%
associate-+r-85.2%
distribute-frac-neg85.2%
Simplified86.0%
Taylor expanded in y around 0 89.9%
+-commutative89.9%
associate--l+83.6%
div-sub83.6%
Simplified83.6%
add-cube-cbrt83.4%
pow383.4%
Applied egg-rr83.4%
Taylor expanded in z around inf 87.4%
mul-1-neg87.4%
associate-/l*86.6%
distribute-frac-neg86.6%
associate-/r/89.3%
Simplified89.3%
if 1.1500000000000001e22 < a Initial program 81.8%
sub-neg81.8%
distribute-frac-neg81.8%
distribute-rgt-neg-out81.8%
associate-/l*92.2%
div-sub92.2%
associate-+r-92.2%
associate-/r/92.6%
distribute-rgt-neg-out92.6%
associate-/r/92.2%
distribute-frac-neg92.2%
associate-+l+92.2%
associate-+r-92.3%
distribute-frac-neg92.3%
Simplified92.3%
Taylor expanded in y around 0 95.1%
+-commutative95.1%
associate--l+94.3%
div-sub94.3%
Simplified94.3%
Taylor expanded in z around 0 88.1%
Final simplification89.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6e-57) (not (<= a 5.2e-51))) (- x (- (/ y (/ a z)) y)) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6e-57) || !(a <= 5.2e-51)) {
tmp = x - ((y / (a / z)) - y);
} 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 <= (-6d-57)) .or. (.not. (a <= 5.2d-51))) then
tmp = x - ((y / (a / z)) - y)
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 <= -6e-57) || !(a <= 5.2e-51)) {
tmp = x - ((y / (a / z)) - y);
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6e-57) or not (a <= 5.2e-51): tmp = x - ((y / (a / z)) - y) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6e-57) || !(a <= 5.2e-51)) tmp = Float64(x - Float64(Float64(y / Float64(a / z)) - y)); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6e-57) || ~((a <= 5.2e-51))) tmp = x - ((y / (a / z)) - y); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6e-57], N[Not[LessEqual[a, 5.2e-51]], $MachinePrecision]], N[(x - N[(N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-57} \lor \neg \left(a \leq 5.2 \cdot 10^{-51}\right):\\
\;\;\;\;x - \left(\frac{y}{\frac{a}{z}} - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if a < -6.00000000000000001e-57 or 5.2e-51 < a Initial program 83.5%
sub-neg83.5%
distribute-frac-neg83.5%
distribute-rgt-neg-out83.5%
associate-/l*91.9%
div-sub91.9%
associate-+r-91.9%
associate-/r/92.4%
distribute-rgt-neg-out92.4%
associate-/r/91.9%
distribute-frac-neg91.9%
associate-+l+91.9%
associate-+r-92.5%
distribute-frac-neg92.5%
Simplified92.5%
Taylor expanded in t around 0 81.8%
associate-/l*86.1%
Simplified86.1%
if -6.00000000000000001e-57 < a < 5.2e-51Initial program 72.5%
sub-neg72.5%
distribute-frac-neg72.5%
distribute-rgt-neg-out72.5%
associate-/l*82.0%
div-sub81.0%
associate-+r-81.0%
associate-/r/81.9%
distribute-rgt-neg-out81.9%
associate-/r/81.0%
distribute-frac-neg81.0%
associate-+l+81.0%
associate-+r-86.3%
distribute-frac-neg86.3%
Simplified87.4%
Taylor expanded in y around 0 92.2%
+-commutative92.2%
associate--l+84.3%
div-sub84.3%
Simplified84.3%
add-cube-cbrt84.1%
pow384.1%
Applied egg-rr84.1%
Taylor expanded in z around inf 91.0%
mul-1-neg91.0%
associate-/l*90.2%
distribute-frac-neg90.2%
associate-/r/93.3%
Simplified93.3%
Taylor expanded in a around 0 90.5%
Final simplification87.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.3e-51) (not (<= a 2.05e-46))) (- x (- (/ y (/ a z)) y)) (- x (/ y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.3e-51) || !(a <= 2.05e-46)) {
tmp = x - ((y / (a / z)) - y);
} else {
tmp = x - (y / (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-4.3d-51)) .or. (.not. (a <= 2.05d-46))) then
tmp = x - ((y / (a / z)) - y)
else
tmp = x - (y / (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.3e-51) || !(a <= 2.05e-46)) {
tmp = x - ((y / (a / z)) - y);
} else {
tmp = x - (y / (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.3e-51) or not (a <= 2.05e-46): tmp = x - ((y / (a / z)) - y) else: tmp = x - (y / (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.3e-51) || !(a <= 2.05e-46)) tmp = Float64(x - Float64(Float64(y / Float64(a / z)) - y)); else tmp = Float64(x - Float64(y / Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.3e-51) || ~((a <= 2.05e-46))) tmp = x - ((y / (a / z)) - y); else tmp = x - (y / (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.3e-51], N[Not[LessEqual[a, 2.05e-46]], $MachinePrecision]], N[(x - N[(N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{-51} \lor \neg \left(a \leq 2.05 \cdot 10^{-46}\right):\\
\;\;\;\;x - \left(\frac{y}{\frac{a}{z}} - y\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\end{array}
\end{array}
if a < -4.2999999999999997e-51 or 2.05e-46 < a Initial program 84.1%
sub-neg84.1%
distribute-frac-neg84.1%
distribute-rgt-neg-out84.1%
associate-/l*92.4%
div-sub92.4%
associate-+r-92.4%
associate-/r/93.0%
distribute-rgt-neg-out93.0%
associate-/r/92.4%
distribute-frac-neg92.4%
associate-+l+92.4%
associate-+r-93.1%
distribute-frac-neg93.1%
Simplified93.1%
Taylor expanded in t around 0 82.3%
associate-/l*86.7%
Simplified86.7%
if -4.2999999999999997e-51 < a < 2.05e-46Initial program 71.8%
sub-neg71.8%
distribute-frac-neg71.8%
distribute-rgt-neg-out71.8%
associate-/l*81.2%
div-sub80.2%
associate-+r-80.2%
associate-/r/81.2%
distribute-rgt-neg-out81.2%
associate-/r/80.2%
distribute-frac-neg80.2%
associate-+l+80.2%
associate-+r-85.5%
distribute-frac-neg85.5%
Simplified86.5%
Taylor expanded in y around 0 91.3%
+-commutative91.3%
associate--l+83.5%
div-sub83.5%
Simplified83.5%
Taylor expanded in t around inf 90.8%
mul-1-neg90.8%
unsub-neg90.8%
associate-/l*90.0%
mul-1-neg90.0%
unsub-neg90.0%
Simplified90.0%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9.8e-18) (not (<= a 1.85e+19))) (- x (- (/ y (/ a z)) y)) (- x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.8e-18) || !(a <= 1.85e+19)) {
tmp = x - ((y / (a / z)) - y);
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-9.8d-18)) .or. (.not. (a <= 1.85d+19))) then
tmp = x - ((y / (a / z)) - y)
else
tmp = x - (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.8e-18) || !(a <= 1.85e+19)) {
tmp = x - ((y / (a / z)) - y);
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9.8e-18) or not (a <= 1.85e+19): tmp = x - ((y / (a / z)) - y) else: tmp = x - (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -9.8e-18) || !(a <= 1.85e+19)) tmp = Float64(x - Float64(Float64(y / Float64(a / z)) - y)); else tmp = Float64(x - Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -9.8e-18) || ~((a <= 1.85e+19))) tmp = x - ((y / (a / z)) - y); else tmp = x - (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -9.8e-18], N[Not[LessEqual[a, 1.85e+19]], $MachinePrecision]], N[(x - N[(N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.8 \cdot 10^{-18} \lor \neg \left(a \leq 1.85 \cdot 10^{+19}\right):\\
\;\;\;\;x - \left(\frac{y}{\frac{a}{z}} - y\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if a < -9.8000000000000002e-18 or 1.85e19 < a Initial program 84.3%
sub-neg84.3%
distribute-frac-neg84.3%
distribute-rgt-neg-out84.3%
associate-/l*94.0%
div-sub94.0%
associate-+r-94.0%
associate-/r/94.6%
distribute-rgt-neg-out94.6%
associate-/r/94.0%
distribute-frac-neg94.0%
associate-+l+94.1%
associate-+r-94.8%
distribute-frac-neg94.8%
Simplified94.8%
Taylor expanded in t around 0 84.5%
associate-/l*89.5%
Simplified89.5%
if -9.8000000000000002e-18 < a < 1.85e19Initial program 73.8%
sub-neg73.8%
distribute-frac-neg73.8%
distribute-rgt-neg-out73.8%
associate-/l*81.5%
div-sub80.6%
associate-+r-80.6%
associate-/r/81.5%
distribute-rgt-neg-out81.5%
associate-/r/80.6%
distribute-frac-neg80.6%
associate-+l+80.6%
associate-+r-85.0%
distribute-frac-neg85.0%
Simplified85.8%
Taylor expanded in z around inf 87.3%
associate-*r/87.3%
associate-*r*87.3%
neg-mul-187.3%
Simplified87.3%
Taylor expanded in x around 0 87.3%
mul-1-neg87.3%
unsub-neg87.3%
associate-/l*86.6%
Simplified86.6%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.5e-18) (- x (- (/ y (/ a z)) y)) (if (<= a 1.6e+22) (- x (/ y (/ (- a t) z))) (- (+ y x) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.5e-18) {
tmp = x - ((y / (a / z)) - y);
} else if (a <= 1.6e+22) {
tmp = x - (y / ((a - t) / z));
} else {
tmp = (y + x) - (y * (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 (a <= (-8.5d-18)) then
tmp = x - ((y / (a / z)) - y)
else if (a <= 1.6d+22) then
tmp = x - (y / ((a - t) / z))
else
tmp = (y + x) - (y * (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 (a <= -8.5e-18) {
tmp = x - ((y / (a / z)) - y);
} else if (a <= 1.6e+22) {
tmp = x - (y / ((a - t) / z));
} else {
tmp = (y + x) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.5e-18: tmp = x - ((y / (a / z)) - y) elif a <= 1.6e+22: tmp = x - (y / ((a - t) / z)) else: tmp = (y + x) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.5e-18) tmp = Float64(x - Float64(Float64(y / Float64(a / z)) - y)); elseif (a <= 1.6e+22) tmp = Float64(x - Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8.5e-18) tmp = x - ((y / (a / z)) - y); elseif (a <= 1.6e+22) tmp = x - (y / ((a - t) / z)); else tmp = (y + x) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.5e-18], N[(x - N[(N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e+22], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-18}:\\
\;\;\;\;x - \left(\frac{y}{\frac{a}{z}} - y\right)\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+22}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -8.4999999999999995e-18Initial program 86.0%
sub-neg86.0%
distribute-frac-neg86.0%
distribute-rgt-neg-out86.0%
associate-/l*95.4%
div-sub95.4%
associate-+r-95.4%
associate-/r/96.1%
distribute-rgt-neg-out96.1%
associate-/r/95.4%
distribute-frac-neg95.4%
associate-+l+95.4%
associate-+r-96.7%
distribute-frac-neg96.7%
Simplified96.7%
Taylor expanded in t around 0 85.6%
associate-/l*91.0%
Simplified91.0%
if -8.4999999999999995e-18 < a < 1.6e22Initial program 74.0%
sub-neg74.0%
distribute-frac-neg74.0%
distribute-rgt-neg-out74.0%
associate-/l*81.6%
div-sub80.8%
associate-+r-80.8%
associate-/r/81.7%
distribute-rgt-neg-out81.7%
associate-/r/80.8%
distribute-frac-neg80.8%
associate-+l+80.8%
associate-+r-85.1%
distribute-frac-neg85.1%
Simplified85.9%
Taylor expanded in z around inf 87.3%
associate-*r/87.3%
associate-*r*87.3%
neg-mul-187.3%
Simplified87.3%
Taylor expanded in x around 0 87.3%
mul-1-neg87.3%
unsub-neg87.3%
associate-/l*86.7%
Simplified86.7%
if 1.6e22 < a Initial program 81.8%
associate-*l/92.6%
Simplified92.6%
Taylor expanded in t around 0 87.4%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.3e-15) (- x (- (/ y (/ a z)) y)) (if (<= a 1.8e+21) (- x (* z (/ y (- a t)))) (- (+ y x) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.3e-15) {
tmp = x - ((y / (a / z)) - y);
} else if (a <= 1.8e+21) {
tmp = x - (z * (y / (a - t)));
} else {
tmp = (y + x) - (y * (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 (a <= (-2.3d-15)) then
tmp = x - ((y / (a / z)) - y)
else if (a <= 1.8d+21) then
tmp = x - (z * (y / (a - t)))
else
tmp = (y + x) - (y * (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 (a <= -2.3e-15) {
tmp = x - ((y / (a / z)) - y);
} else if (a <= 1.8e+21) {
tmp = x - (z * (y / (a - t)));
} else {
tmp = (y + x) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.3e-15: tmp = x - ((y / (a / z)) - y) elif a <= 1.8e+21: tmp = x - (z * (y / (a - t))) else: tmp = (y + x) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.3e-15) tmp = Float64(x - Float64(Float64(y / Float64(a / z)) - y)); elseif (a <= 1.8e+21) tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.3e-15) tmp = x - ((y / (a / z)) - y); elseif (a <= 1.8e+21) tmp = x - (z * (y / (a - t))); else tmp = (y + x) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.3e-15], N[(x - N[(N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e+21], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{-15}:\\
\;\;\;\;x - \left(\frac{y}{\frac{a}{z}} - y\right)\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+21}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -2.2999999999999999e-15Initial program 85.8%
sub-neg85.8%
distribute-frac-neg85.8%
distribute-rgt-neg-out85.8%
associate-/l*95.3%
div-sub95.3%
associate-+r-95.3%
associate-/r/96.0%
distribute-rgt-neg-out96.0%
associate-/r/95.3%
distribute-frac-neg95.3%
associate-+l+95.4%
associate-+r-96.7%
distribute-frac-neg96.7%
Simplified96.7%
Taylor expanded in t around 0 85.4%
associate-/l*91.1%
Simplified91.1%
if -2.2999999999999999e-15 < a < 1.8e21Initial program 74.2%
sub-neg74.2%
distribute-frac-neg74.2%
distribute-rgt-neg-out74.2%
associate-/l*81.7%
div-sub80.9%
associate-+r-80.9%
associate-/r/81.8%
distribute-rgt-neg-out81.8%
associate-/r/80.9%
distribute-frac-neg80.9%
associate-+l+80.9%
associate-+r-85.2%
distribute-frac-neg85.2%
Simplified86.0%
Taylor expanded in y around 0 89.9%
+-commutative89.9%
associate--l+83.6%
div-sub83.6%
Simplified83.6%
add-cube-cbrt83.4%
pow383.4%
Applied egg-rr83.4%
Taylor expanded in z around inf 87.4%
mul-1-neg87.4%
associate-/l*86.6%
distribute-frac-neg86.6%
associate-/r/89.3%
Simplified89.3%
if 1.8e21 < a Initial program 81.8%
associate-*l/92.6%
Simplified92.6%
Taylor expanded in t around 0 87.4%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (+ x (+ y (/ (- t z) (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
return x + (y + ((t - z) / ((a - t) / y)));
}
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 + ((t - z) / ((a - t) / y)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y + ((t - z) / ((a - t) / y)));
}
def code(x, y, z, t, a): return x + (y + ((t - z) / ((a - t) / y)))
function code(x, y, z, t, a) return Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y + ((t - z) / ((a - t) / y))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)
\end{array}
Initial program 79.2%
sub-neg79.2%
distribute-frac-neg79.2%
distribute-rgt-neg-out79.2%
associate-/l*88.0%
div-sub87.6%
associate-+r-87.6%
associate-/r/88.3%
distribute-rgt-neg-out88.3%
associate-/r/87.6%
distribute-frac-neg87.6%
associate-+l+87.6%
associate-+r-90.1%
distribute-frac-neg90.1%
Simplified90.5%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.4e-18) (+ y x) (if (<= a 3.8e-8) (+ x (* z (/ y t))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.4e-18) {
tmp = y + x;
} else if (a <= 3.8e-8) {
tmp = x + (z * (y / t));
} else {
tmp = y + 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) :: tmp
if (a <= (-4.4d-18)) then
tmp = y + x
else if (a <= 3.8d-8) then
tmp = x + (z * (y / t))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.4e-18) {
tmp = y + x;
} else if (a <= 3.8e-8) {
tmp = x + (z * (y / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.4e-18: tmp = y + x elif a <= 3.8e-8: tmp = x + (z * (y / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.4e-18) tmp = Float64(y + x); elseif (a <= 3.8e-8) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.4e-18) tmp = y + x; elseif (a <= 3.8e-8) tmp = x + (z * (y / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.4e-18], N[(y + x), $MachinePrecision], If[LessEqual[a, 3.8e-8], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.4 \cdot 10^{-18}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{-8}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -4.3999999999999997e-18 or 3.80000000000000028e-8 < a Initial program 83.8%
sub-neg83.8%
distribute-frac-neg83.8%
distribute-rgt-neg-out83.8%
associate-/l*93.0%
div-sub93.0%
associate-+r-93.0%
associate-/r/93.6%
distribute-rgt-neg-out93.6%
associate-/r/93.0%
distribute-frac-neg93.0%
associate-+l+93.0%
associate-+r-93.8%
distribute-frac-neg93.8%
Simplified93.8%
Taylor expanded in a around inf 81.9%
+-commutative81.9%
Simplified81.9%
if -4.3999999999999997e-18 < a < 3.80000000000000028e-8Initial program 73.6%
sub-neg73.6%
distribute-frac-neg73.6%
distribute-rgt-neg-out73.6%
associate-/l*81.8%
div-sub80.9%
associate-+r-80.9%
associate-/r/81.9%
distribute-rgt-neg-out81.9%
associate-/r/80.9%
distribute-frac-neg80.9%
associate-+l+80.9%
associate-+r-85.6%
distribute-frac-neg85.6%
Simplified86.5%
Taylor expanded in y around 0 91.5%
+-commutative91.5%
associate--l+84.7%
div-sub84.7%
Simplified84.7%
add-cube-cbrt84.4%
pow384.5%
Applied egg-rr84.5%
Taylor expanded in z around inf 88.8%
mul-1-neg88.8%
associate-/l*88.1%
distribute-frac-neg88.1%
associate-/r/90.8%
Simplified90.8%
Taylor expanded in a around 0 85.0%
Final simplification83.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.4e-49) (+ y x) (if (<= a 6.5e-268) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.4e-49) {
tmp = y + x;
} else if (a <= 6.5e-268) {
tmp = x;
} else {
tmp = y + 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) :: tmp
if (a <= (-2.4d-49)) then
tmp = y + x
else if (a <= 6.5d-268) then
tmp = x
else
tmp = y + x
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.4e-49) {
tmp = y + x;
} else if (a <= 6.5e-268) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.4e-49: tmp = y + x elif a <= 6.5e-268: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.4e-49) tmp = Float64(y + x); elseif (a <= 6.5e-268) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.4e-49) tmp = y + x; elseif (a <= 6.5e-268) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.4e-49], N[(y + x), $MachinePrecision], If[LessEqual[a, 6.5e-268], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{-49}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-268}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -2.39999999999999992e-49 or 6.5000000000000003e-268 < a Initial program 82.2%
sub-neg82.2%
distribute-frac-neg82.2%
distribute-rgt-neg-out82.2%
associate-/l*91.4%
div-sub91.4%
associate-+r-91.4%
associate-/r/91.8%
distribute-rgt-neg-out91.8%
associate-/r/91.4%
distribute-frac-neg91.4%
associate-+l+91.4%
associate-+r-91.9%
distribute-frac-neg91.9%
Simplified91.9%
Taylor expanded in a around inf 73.1%
+-commutative73.1%
Simplified73.1%
if -2.39999999999999992e-49 < a < 6.5000000000000003e-268Initial program 67.3%
sub-neg67.3%
distribute-frac-neg67.3%
distribute-rgt-neg-out67.3%
associate-/l*74.4%
div-sub72.4%
associate-+r-72.4%
associate-/r/74.4%
distribute-rgt-neg-out74.4%
associate-/r/72.4%
distribute-frac-neg72.4%
associate-+l+72.4%
associate-+r-83.0%
distribute-frac-neg83.0%
Simplified85.0%
Taylor expanded in x around inf 64.1%
Final simplification71.3%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 79.2%
sub-neg79.2%
distribute-frac-neg79.2%
distribute-rgt-neg-out79.2%
associate-/l*88.0%
div-sub87.6%
associate-+r-87.6%
associate-/r/88.3%
distribute-rgt-neg-out88.3%
associate-/r/87.6%
distribute-frac-neg87.6%
associate-+l+87.6%
associate-+r-90.1%
distribute-frac-neg90.1%
Simplified90.5%
Taylor expanded in x around inf 54.2%
Final simplification54.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} 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 + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
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 + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023279
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))