
(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
(let* ((t_1 (+ (+ x y) (/ (* y (- z t)) (- t a)))))
(if (<= t_1 -1e-257)
(- (+ x y) (* y (/ z (- a t))))
(if (<= t_1 0.0)
(+ x (/ (* y (- z a)) t))
(fma (- z t) (/ y (- t a)) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (z - t)) / (t - a));
double tmp;
if (t_1 <= -1e-257) {
tmp = (x + y) - (y * (z / (a - t)));
} else if (t_1 <= 0.0) {
tmp = x + ((y * (z - a)) / t);
} else {
tmp = fma((z - t), (y / (t - a)), (x + y));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(z - t)) / Float64(t - a))) tmp = 0.0 if (t_1 <= -1e-257) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / Float64(a - t)))); elseif (t_1 <= 0.0) tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); else tmp = fma(Float64(z - t), Float64(y / Float64(t - a)), Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-257], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(z - t\right)}{t - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-257}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -9.9999999999999998e-258Initial program 85.1%
Taylor expanded in z around inf 87.7%
associate-/l*92.6%
Simplified92.6%
if -9.9999999999999998e-258 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.0%
Taylor expanded in t around inf 100.0%
associate--l+100.0%
distribute-lft-out--100.0%
div-sub100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
distribute-lft-out--100.0%
Simplified100.0%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 89.2%
sub-neg89.2%
+-commutative89.2%
distribute-frac-neg89.2%
distribute-rgt-neg-out89.2%
associate-/l*92.9%
fma-define93.1%
distribute-frac-neg93.1%
distribute-neg-frac293.1%
sub-neg93.1%
distribute-neg-in93.1%
remove-double-neg93.1%
+-commutative93.1%
sub-neg93.1%
Simplified93.1%
Final simplification93.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (/ (* y (- z t)) (- t a)))))
(if (<= t_1 -1e-257)
(- (+ x y) (* y (/ z (- a t))))
(if (<= t_1 0.0)
(+ x (/ (* y (- z a)) t))
(+ (+ x y) (* (- t z) (/ y (- a t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (z - t)) / (t - a));
double tmp;
if (t_1 <= -1e-257) {
tmp = (x + y) - (y * (z / (a - t)));
} else if (t_1 <= 0.0) {
tmp = x + ((y * (z - a)) / t);
} else {
tmp = (x + y) + ((t - 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) :: t_1
real(8) :: tmp
t_1 = (x + y) + ((y * (z - t)) / (t - a))
if (t_1 <= (-1d-257)) then
tmp = (x + y) - (y * (z / (a - t)))
else if (t_1 <= 0.0d0) then
tmp = x + ((y * (z - a)) / t)
else
tmp = (x + y) + ((t - 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 t_1 = (x + y) + ((y * (z - t)) / (t - a));
double tmp;
if (t_1 <= -1e-257) {
tmp = (x + y) - (y * (z / (a - t)));
} else if (t_1 <= 0.0) {
tmp = x + ((y * (z - a)) / t);
} else {
tmp = (x + y) + ((t - z) * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) + ((y * (z - t)) / (t - a)) tmp = 0 if t_1 <= -1e-257: tmp = (x + y) - (y * (z / (a - t))) elif t_1 <= 0.0: tmp = x + ((y * (z - a)) / t) else: tmp = (x + y) + ((t - z) * (y / (a - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(z - t)) / Float64(t - a))) tmp = 0.0 if (t_1 <= -1e-257) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / Float64(a - t)))); elseif (t_1 <= 0.0) tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); else tmp = Float64(Float64(x + y) + Float64(Float64(t - z) * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) + ((y * (z - t)) / (t - a)); tmp = 0.0; if (t_1 <= -1e-257) tmp = (x + y) - (y * (z / (a - t))); elseif (t_1 <= 0.0) tmp = x + ((y * (z - a)) / t); else tmp = (x + y) + ((t - z) * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-257], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(t - z), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(z - t\right)}{t - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-257}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(t - z\right) \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -9.9999999999999998e-258Initial program 85.1%
Taylor expanded in z around inf 87.7%
associate-/l*92.6%
Simplified92.6%
if -9.9999999999999998e-258 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.0%
Taylor expanded in t around inf 100.0%
associate--l+100.0%
distribute-lft-out--100.0%
div-sub100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
distribute-lft-out--100.0%
Simplified100.0%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 89.2%
Taylor expanded in y around 0 89.2%
associate-*l/92.9%
Simplified92.9%
Final simplification93.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z (- t a)))))
(if (<= a -8.2e-50)
(+ x y)
(if (<= a -1.52e-62)
t_1
(if (<= a -2.5e-102)
(- x (/ (* y a) t))
(if (<= a -4e-133)
t_1
(if (or (<= a -7.2e-152) (not (<= a 1.8e+118)))
(+ x y)
(+ x (/ (* y z) t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / (t - a));
double tmp;
if (a <= -8.2e-50) {
tmp = x + y;
} else if (a <= -1.52e-62) {
tmp = t_1;
} else if (a <= -2.5e-102) {
tmp = x - ((y * a) / t);
} else if (a <= -4e-133) {
tmp = t_1;
} else if ((a <= -7.2e-152) || !(a <= 1.8e+118)) {
tmp = x + y;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (z / (t - a))
if (a <= (-8.2d-50)) then
tmp = x + y
else if (a <= (-1.52d-62)) then
tmp = t_1
else if (a <= (-2.5d-102)) then
tmp = x - ((y * a) / t)
else if (a <= (-4d-133)) then
tmp = t_1
else if ((a <= (-7.2d-152)) .or. (.not. (a <= 1.8d+118))) then
tmp = x + y
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 t_1 = y * (z / (t - a));
double tmp;
if (a <= -8.2e-50) {
tmp = x + y;
} else if (a <= -1.52e-62) {
tmp = t_1;
} else if (a <= -2.5e-102) {
tmp = x - ((y * a) / t);
} else if (a <= -4e-133) {
tmp = t_1;
} else if ((a <= -7.2e-152) || !(a <= 1.8e+118)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / (t - a)) tmp = 0 if a <= -8.2e-50: tmp = x + y elif a <= -1.52e-62: tmp = t_1 elif a <= -2.5e-102: tmp = x - ((y * a) / t) elif a <= -4e-133: tmp = t_1 elif (a <= -7.2e-152) or not (a <= 1.8e+118): tmp = x + y else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(t - a))) tmp = 0.0 if (a <= -8.2e-50) tmp = Float64(x + y); elseif (a <= -1.52e-62) tmp = t_1; elseif (a <= -2.5e-102) tmp = Float64(x - Float64(Float64(y * a) / t)); elseif (a <= -4e-133) tmp = t_1; elseif ((a <= -7.2e-152) || !(a <= 1.8e+118)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / (t - a)); tmp = 0.0; if (a <= -8.2e-50) tmp = x + y; elseif (a <= -1.52e-62) tmp = t_1; elseif (a <= -2.5e-102) tmp = x - ((y * a) / t); elseif (a <= -4e-133) tmp = t_1; elseif ((a <= -7.2e-152) || ~((a <= 1.8e+118))) tmp = x + y; else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.2e-50], N[(x + y), $MachinePrecision], If[LessEqual[a, -1.52e-62], t$95$1, If[LessEqual[a, -2.5e-102], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4e-133], t$95$1, If[Or[LessEqual[a, -7.2e-152], N[Not[LessEqual[a, 1.8e+118]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t - a}\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{-50}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -1.52 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.5 \cdot 10^{-102}:\\
\;\;\;\;x - \frac{y \cdot a}{t}\\
\mathbf{elif}\;a \leq -4 \cdot 10^{-133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -7.2 \cdot 10^{-152} \lor \neg \left(a \leq 1.8 \cdot 10^{+118}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -8.19999999999999971e-50 or -4.0000000000000003e-133 < a < -7.2e-152 or 1.8e118 < a Initial program 87.0%
Taylor expanded in a around inf 88.7%
+-commutative88.7%
Simplified88.7%
if -8.19999999999999971e-50 < a < -1.52000000000000007e-62 or -2.50000000000000013e-102 < a < -4.0000000000000003e-133Initial program 74.9%
sub-neg74.9%
+-commutative74.9%
distribute-frac-neg74.9%
distribute-rgt-neg-out74.9%
associate-/l*79.8%
fma-define80.5%
distribute-frac-neg80.5%
distribute-neg-frac280.5%
sub-neg80.5%
distribute-neg-in80.5%
remove-double-neg80.5%
+-commutative80.5%
sub-neg80.5%
Simplified80.5%
Taylor expanded in z around inf 69.6%
associate-/l*79.8%
Simplified79.8%
if -1.52000000000000007e-62 < a < -2.50000000000000013e-102Initial program 62.2%
sub-neg62.2%
+-commutative62.2%
distribute-frac-neg62.2%
distribute-rgt-neg-out62.2%
associate-/l*62.0%
fma-define61.9%
distribute-frac-neg61.9%
distribute-neg-frac261.9%
sub-neg61.9%
distribute-neg-in61.9%
remove-double-neg61.9%
+-commutative61.9%
sub-neg61.9%
Simplified61.9%
Taylor expanded in t around inf 91.5%
associate-+r+91.5%
distribute-rgt1-in91.5%
metadata-eval91.5%
mul0-lft91.5%
associate-+r+91.5%
associate-/l*91.5%
associate-/l*91.5%
Simplified91.5%
Taylor expanded in z around 0 91.0%
if -7.2e-152 < a < 1.8e118Initial program 78.5%
sub-neg78.5%
+-commutative78.5%
distribute-frac-neg78.5%
distribute-rgt-neg-out78.5%
associate-/l*80.5%
fma-define80.5%
distribute-frac-neg80.5%
distribute-neg-frac280.5%
sub-neg80.5%
distribute-neg-in80.5%
remove-double-neg80.5%
+-commutative80.5%
sub-neg80.5%
Simplified80.5%
Taylor expanded in t around inf 73.9%
associate-+r+79.2%
distribute-rgt1-in79.2%
metadata-eval79.2%
mul0-lft79.2%
associate-+r+79.2%
associate-/l*83.3%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in a around 0 77.9%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.65e+82) (not (<= t 6.5e+120))) (+ x (/ (* y (- z a)) t)) (- (+ x y) (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.65e+82) || !(t <= 6.5e+120)) {
tmp = x + ((y * (z - a)) / t);
} else {
tmp = (x + y) - (y * (z / (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 ((t <= (-1.65d+82)) .or. (.not. (t <= 6.5d+120))) then
tmp = x + ((y * (z - a)) / t)
else
tmp = (x + y) - (y * (z / (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 ((t <= -1.65e+82) || !(t <= 6.5e+120)) {
tmp = x + ((y * (z - a)) / t);
} else {
tmp = (x + y) - (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.65e+82) or not (t <= 6.5e+120): tmp = x + ((y * (z - a)) / t) else: tmp = (x + y) - (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.65e+82) || !(t <= 6.5e+120)) tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.65e+82) || ~((t <= 6.5e+120))) tmp = x + ((y * (z - a)) / t); else tmp = (x + y) - (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.65e+82], N[Not[LessEqual[t, 6.5e+120]], $MachinePrecision]], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+82} \lor \neg \left(t \leq 6.5 \cdot 10^{+120}\right):\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1.6499999999999999e82 or 6.4999999999999997e120 < t Initial program 63.4%
Taylor expanded in t around inf 85.9%
associate--l+85.9%
distribute-lft-out--85.9%
div-sub85.9%
mul-1-neg85.9%
unsub-neg85.9%
*-commutative85.9%
distribute-lft-out--85.9%
Simplified85.9%
if -1.6499999999999999e82 < t < 6.4999999999999997e120Initial program 87.8%
Taylor expanded in z around inf 87.8%
associate-/l*92.5%
Simplified92.5%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.35e-61) (not (<= a 2e-54))) (- (+ x y) (/ y (/ a z))) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.35e-61) || !(a <= 2e-54)) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x + ((y * (z - 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.35d-61)) .or. (.not. (a <= 2d-54))) then
tmp = (x + y) - (y / (a / z))
else
tmp = x + ((y * (z - 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.35e-61) || !(a <= 2e-54)) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.35e-61) or not (a <= 2e-54): tmp = (x + y) - (y / (a / z)) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.35e-61) || !(a <= 2e-54)) tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.35e-61) || ~((a <= 2e-54))) tmp = (x + y) - (y / (a / z)); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.35e-61], N[Not[LessEqual[a, 2e-54]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{-61} \lor \neg \left(a \leq 2 \cdot 10^{-54}\right):\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -1.34999999999999997e-61 or 2.0000000000000001e-54 < a Initial program 85.1%
Taylor expanded in t around 0 83.8%
+-commutative83.8%
associate-/l*88.8%
Simplified88.8%
clear-num88.8%
un-div-inv88.8%
Applied egg-rr88.8%
if -1.34999999999999997e-61 < a < 2.0000000000000001e-54Initial program 76.1%
Taylor expanded in t around inf 80.1%
associate--l+80.1%
distribute-lft-out--80.1%
div-sub82.0%
mul-1-neg82.0%
unsub-neg82.0%
*-commutative82.0%
distribute-lft-out--82.0%
Simplified82.0%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.1e-61) (not (<= a 2.8e-54))) (- (+ x y) (* y (/ z a))) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.1e-61) || !(a <= 2.8e-54)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y * (z - 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.1d-61)) .or. (.not. (a <= 2.8d-54))) then
tmp = (x + y) - (y * (z / a))
else
tmp = x + ((y * (z - 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.1e-61) || !(a <= 2.8e-54)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.1e-61) or not (a <= 2.8e-54): tmp = (x + y) - (y * (z / a)) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.1e-61) || !(a <= 2.8e-54)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.1e-61) || ~((a <= 2.8e-54))) tmp = (x + y) - (y * (z / a)); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.1e-61], N[Not[LessEqual[a, 2.8e-54]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{-61} \lor \neg \left(a \leq 2.8 \cdot 10^{-54}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -2.0999999999999999e-61 or 2.8000000000000002e-54 < a Initial program 85.1%
Taylor expanded in t around 0 83.8%
+-commutative83.8%
associate-/l*88.8%
Simplified88.8%
if -2.0999999999999999e-61 < a < 2.8000000000000002e-54Initial program 76.1%
Taylor expanded in t around inf 80.1%
associate--l+80.1%
distribute-lft-out--80.1%
div-sub82.0%
mul-1-neg82.0%
unsub-neg82.0%
*-commutative82.0%
distribute-lft-out--82.0%
Simplified82.0%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.2e-21) (not (<= a 1.8e+118))) (+ x y) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.2e-21) || !(a <= 1.8e+118)) {
tmp = x + y;
} else {
tmp = x + ((y * (z - 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 <= (-5.2d-21)) .or. (.not. (a <= 1.8d+118))) then
tmp = x + y
else
tmp = x + ((y * (z - 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 <= -5.2e-21) || !(a <= 1.8e+118)) {
tmp = x + y;
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.2e-21) or not (a <= 1.8e+118): tmp = x + y else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.2e-21) || !(a <= 1.8e+118)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5.2e-21) || ~((a <= 1.8e+118))) tmp = x + y; else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.2e-21], N[Not[LessEqual[a, 1.8e+118]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-21} \lor \neg \left(a \leq 1.8 \cdot 10^{+118}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -5.20000000000000035e-21 or 1.8e118 < a Initial program 85.9%
Taylor expanded in a around inf 87.7%
+-commutative87.7%
Simplified87.7%
if -5.20000000000000035e-21 < a < 1.8e118Initial program 78.2%
Taylor expanded in t around inf 76.1%
associate--l+76.1%
distribute-lft-out--76.1%
div-sub77.5%
mul-1-neg77.5%
unsub-neg77.5%
*-commutative77.5%
distribute-lft-out--77.5%
Simplified77.5%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.3e+31) (not (<= a 1.8e+118))) (+ x y) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.3e+31) || !(a <= 1.8e+118)) {
tmp = x + y;
} 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 <= (-3.3d+31)) .or. (.not. (a <= 1.8d+118))) then
tmp = x + y
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 <= -3.3e+31) || !(a <= 1.8e+118)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.3e+31) or not (a <= 1.8e+118): tmp = x + y else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.3e+31) || !(a <= 1.8e+118)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.3e+31) || ~((a <= 1.8e+118))) tmp = x + y; else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.3e+31], N[Not[LessEqual[a, 1.8e+118]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.3 \cdot 10^{+31} \lor \neg \left(a \leq 1.8 \cdot 10^{+118}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -3.29999999999999992e31 or 1.8e118 < a Initial program 86.7%
Taylor expanded in a around inf 89.0%
+-commutative89.0%
Simplified89.0%
if -3.29999999999999992e31 < a < 1.8e118Initial program 78.1%
sub-neg78.1%
+-commutative78.1%
distribute-frac-neg78.1%
distribute-rgt-neg-out78.1%
associate-/l*80.6%
fma-define80.7%
distribute-frac-neg80.7%
distribute-neg-frac280.7%
sub-neg80.7%
distribute-neg-in80.7%
remove-double-neg80.7%
+-commutative80.7%
sub-neg80.7%
Simplified80.7%
Taylor expanded in t around inf 70.7%
associate-+r+75.5%
distribute-rgt1-in75.5%
metadata-eval75.5%
mul0-lft75.5%
associate-+r+75.5%
associate-/l*79.6%
associate-/l*77.8%
Simplified77.8%
Taylor expanded in a around 0 74.0%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e+219) (not (<= z 1.15e+176))) (* y (/ z (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+219) || !(z <= 1.15e+176)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.5d+219)) .or. (.not. (z <= 1.15d+176))) then
tmp = y * (z / (t - a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+219) || !(z <= 1.15e+176)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e+219) or not (z <= 1.15e+176): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e+219) || !(z <= 1.15e+176)) tmp = Float64(y * Float64(z / Float64(t - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.5e+219) || ~((z <= 1.15e+176))) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e+219], N[Not[LessEqual[z, 1.15e+176]], $MachinePrecision]], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+219} \lor \neg \left(z \leq 1.15 \cdot 10^{+176}\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.50000000000000023e219 or 1.14999999999999998e176 < z Initial program 81.2%
sub-neg81.2%
+-commutative81.2%
distribute-frac-neg81.2%
distribute-rgt-neg-out81.2%
associate-/l*90.7%
fma-define91.0%
distribute-frac-neg91.0%
distribute-neg-frac291.0%
sub-neg91.0%
distribute-neg-in91.0%
remove-double-neg91.0%
+-commutative91.0%
sub-neg91.0%
Simplified91.0%
Taylor expanded in z around inf 60.3%
associate-/l*70.1%
Simplified70.1%
if -4.50000000000000023e219 < z < 1.14999999999999998e176Initial program 81.4%
Taylor expanded in a around inf 71.9%
+-commutative71.9%
Simplified71.9%
Final simplification71.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.8e+220) (not (<= z 2.5e+175))) (* y (/ z t)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e+220) || !(z <= 2.5e+175)) {
tmp = y * (z / t);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-8.8d+220)) .or. (.not. (z <= 2.5d+175))) then
tmp = y * (z / t)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e+220) || !(z <= 2.5e+175)) {
tmp = y * (z / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.8e+220) or not (z <= 2.5e+175): tmp = y * (z / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.8e+220) || !(z <= 2.5e+175)) tmp = Float64(y * Float64(z / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.8e+220) || ~((z <= 2.5e+175))) tmp = y * (z / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.8e+220], N[Not[LessEqual[z, 2.5e+175]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+220} \lor \neg \left(z \leq 2.5 \cdot 10^{+175}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -8.79999999999999957e220 or 2.5e175 < z Initial program 81.2%
sub-neg81.2%
+-commutative81.2%
distribute-frac-neg81.2%
distribute-rgt-neg-out81.2%
associate-/l*90.7%
fma-define91.0%
distribute-frac-neg91.0%
distribute-neg-frac291.0%
sub-neg91.0%
distribute-neg-in91.0%
remove-double-neg91.0%
+-commutative91.0%
sub-neg91.0%
Simplified91.0%
Taylor expanded in z around inf 60.3%
associate-/l*70.1%
Simplified70.1%
Taylor expanded in t around inf 41.9%
associate-/l*49.7%
Simplified49.7%
if -8.79999999999999957e220 < z < 2.5e175Initial program 81.4%
Taylor expanded in a around inf 71.9%
+-commutative71.9%
Simplified71.9%
Final simplification67.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.4e+220) (* z (/ y t)) (if (<= z 7.8e+176) (+ x y) (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.4e+220) {
tmp = z * (y / t);
} else if (z <= 7.8e+176) {
tmp = x + y;
} else {
tmp = 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 <= (-5.4d+220)) then
tmp = z * (y / t)
else if (z <= 7.8d+176) then
tmp = x + y
else
tmp = 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 <= -5.4e+220) {
tmp = z * (y / t);
} else if (z <= 7.8e+176) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.4e+220: tmp = z * (y / t) elif z <= 7.8e+176: tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.4e+220) tmp = Float64(z * Float64(y / t)); elseif (z <= 7.8e+176) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.4e+220) tmp = z * (y / t); elseif (z <= 7.8e+176) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.4e+220], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+176], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+220}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+176}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -5.3999999999999995e220Initial program 76.7%
sub-neg76.7%
+-commutative76.7%
distribute-frac-neg76.7%
distribute-rgt-neg-out76.7%
associate-/l*96.0%
fma-define96.1%
distribute-frac-neg96.1%
distribute-neg-frac296.1%
sub-neg96.1%
distribute-neg-in96.1%
remove-double-neg96.1%
+-commutative96.1%
sub-neg96.1%
Simplified96.1%
Taylor expanded in z around inf 53.4%
associate-/l*65.3%
Simplified65.3%
Taylor expanded in t around inf 37.1%
*-commutative37.1%
associate-/l*45.2%
Applied egg-rr45.2%
if -5.3999999999999995e220 < z < 7.8000000000000003e176Initial program 81.4%
Taylor expanded in a around inf 71.9%
+-commutative71.9%
Simplified71.9%
if 7.8000000000000003e176 < z Initial program 85.7%
sub-neg85.7%
+-commutative85.7%
distribute-frac-neg85.7%
distribute-rgt-neg-out85.7%
associate-/l*85.4%
fma-define85.9%
distribute-frac-neg85.9%
distribute-neg-frac285.9%
sub-neg85.9%
distribute-neg-in85.9%
remove-double-neg85.9%
+-commutative85.9%
sub-neg85.9%
Simplified85.9%
Taylor expanded in z around inf 67.1%
associate-/l*74.8%
Simplified74.8%
Taylor expanded in t around inf 46.7%
associate-/l*54.5%
Simplified54.5%
Final simplification67.8%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + 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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 81.4%
Taylor expanded in a around inf 63.0%
+-commutative63.0%
Simplified63.0%
Final simplification63.0%
(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 81.4%
Taylor expanded in x around inf 51.5%
(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 2024091
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(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))))