
(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 16 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 (- t z)) (- a t)))))
(if (or (<= t_1 -1e-296) (not (<= t_1 0.0)))
(+ x (fma (/ (- t z) (- a t)) y y))
(+ (- x (/ (* y a) t)) (/ (* y z) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -1e-296) || !(t_1 <= 0.0)) {
tmp = x + fma(((t - z) / (a - t)), y, y);
} else {
tmp = (x - ((y * a) / t)) + ((y * z) / t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -1e-296) || !(t_1 <= 0.0)) tmp = Float64(x + fma(Float64(Float64(t - z) / Float64(a - t)), y, y)); else tmp = Float64(Float64(x - Float64(Float64(y * a) / t)) + Float64(Float64(y * z) / t)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-296], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(x + N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + y), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-296} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;x + \mathsf{fma}\left(\frac{t - z}{a - t}, y, y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y \cdot a}{t}\right) + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1e-296 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 82.4%
associate--l+82.6%
sub-neg82.6%
+-commutative82.6%
associate-/l*90.2%
distribute-neg-frac90.2%
associate-/r/93.5%
fma-def93.5%
sub-neg93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
remove-double-neg93.5%
Simplified93.5%
if -1e-296 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.2%
associate-*l/4.2%
Simplified4.2%
Taylor expanded in t around inf 100.0%
Final simplification94.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (<= t_1 -1e-296)
(+ x (+ y (/ (- t z) (/ (- a t) y))))
(if (<= t_1 0.0)
(- x (/ (* y (- a z)) t))
(if (<= t_1 1e+291) t_1 (- x (* z (/ y (- a t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_1 <= -1e-296) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else if (t_1 <= 0.0) {
tmp = x - ((y * (a - z)) / t);
} else if (t_1 <= 1e+291) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x + y) + ((y * (t - z)) / (a - t))
if (t_1 <= (-1d-296)) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
else if (t_1 <= 0.0d0) then
tmp = x - ((y * (a - z)) / t)
else if (t_1 <= 1d+291) then
tmp = t_1
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 t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_1 <= -1e-296) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else if (t_1 <= 0.0) {
tmp = x - ((y * (a - z)) / t);
} else if (t_1 <= 1e+291) {
tmp = t_1;
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if t_1 <= -1e-296: tmp = x + (y + ((t - z) / ((a - t) / y))) elif t_1 <= 0.0: tmp = x - ((y * (a - z)) / t) elif t_1 <= 1e+291: tmp = t_1 else: tmp = x - (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if (t_1 <= -1e-296) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); elseif (t_1 <= 0.0) tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); elseif (t_1 <= 1e+291) tmp = t_1; else tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if (t_1 <= -1e-296) tmp = x + (y + ((t - z) / ((a - t) / y))); elseif (t_1 <= 0.0) tmp = x - ((y * (a - z)) / t); elseif (t_1 <= 1e+291) tmp = t_1; else tmp = x - (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[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-296], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+291], t$95$1, N[(x - N[(z * 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(t - z\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-296}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\mathbf{elif}\;t_1 \leq 10^{+291}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1e-296Initial program 83.1%
associate--l+83.5%
associate-/l*91.8%
Simplified91.8%
if -1e-296 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.2%
associate-*l/4.2%
Simplified4.2%
Taylor expanded in t around -inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
distribute-lft-out--99.9%
Simplified99.9%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.9999999999999996e290Initial program 97.1%
if 9.9999999999999996e290 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 39.7%
associate--l+39.7%
sub-neg39.7%
+-commutative39.7%
associate-/l*72.4%
distribute-neg-frac72.4%
associate-/r/75.4%
fma-def75.4%
sub-neg75.4%
+-commutative75.4%
distribute-neg-in75.4%
unsub-neg75.4%
remove-double-neg75.4%
Simplified75.4%
Taylor expanded in z around inf 64.5%
mul-1-neg64.5%
*-commutative64.5%
associate-*r/84.9%
distribute-lft-neg-in84.9%
Simplified84.9%
Final simplification93.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (<= t_1 -1e-296)
(+ x (+ y (/ (- t z) (/ (- a t) y))))
(if (<= t_1 0.0)
(+ (- x (/ (* y a) t)) (/ (* y z) t))
(if (<= t_1 1e+291) t_1 (- x (* z (/ y (- a t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_1 <= -1e-296) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else if (t_1 <= 0.0) {
tmp = (x - ((y * a) / t)) + ((y * z) / t);
} else if (t_1 <= 1e+291) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x + y) + ((y * (t - z)) / (a - t))
if (t_1 <= (-1d-296)) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
else if (t_1 <= 0.0d0) then
tmp = (x - ((y * a) / t)) + ((y * z) / t)
else if (t_1 <= 1d+291) then
tmp = t_1
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 t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_1 <= -1e-296) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else if (t_1 <= 0.0) {
tmp = (x - ((y * a) / t)) + ((y * z) / t);
} else if (t_1 <= 1e+291) {
tmp = t_1;
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if t_1 <= -1e-296: tmp = x + (y + ((t - z) / ((a - t) / y))) elif t_1 <= 0.0: tmp = (x - ((y * a) / t)) + ((y * z) / t) elif t_1 <= 1e+291: tmp = t_1 else: tmp = x - (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if (t_1 <= -1e-296) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); elseif (t_1 <= 0.0) tmp = Float64(Float64(x - Float64(Float64(y * a) / t)) + Float64(Float64(y * z) / t)); elseif (t_1 <= 1e+291) tmp = t_1; else tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if (t_1 <= -1e-296) tmp = x + (y + ((t - z) / ((a - t) / y))); elseif (t_1 <= 0.0) tmp = (x - ((y * a) / t)) + ((y * z) / t); elseif (t_1 <= 1e+291) tmp = t_1; else tmp = x - (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[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-296], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+291], t$95$1, N[(x - N[(z * 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(t - z\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-296}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\left(x - \frac{y \cdot a}{t}\right) + \frac{y \cdot z}{t}\\
\mathbf{elif}\;t_1 \leq 10^{+291}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1e-296Initial program 83.1%
associate--l+83.5%
associate-/l*91.8%
Simplified91.8%
if -1e-296 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.2%
associate-*l/4.2%
Simplified4.2%
Taylor expanded in t around inf 100.0%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.9999999999999996e290Initial program 97.1%
if 9.9999999999999996e290 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 39.7%
associate--l+39.7%
sub-neg39.7%
+-commutative39.7%
associate-/l*72.4%
distribute-neg-frac72.4%
associate-/r/75.4%
fma-def75.4%
sub-neg75.4%
+-commutative75.4%
distribute-neg-in75.4%
unsub-neg75.4%
remove-double-neg75.4%
Simplified75.4%
Taylor expanded in z around inf 64.5%
mul-1-neg64.5%
*-commutative64.5%
associate-*r/84.9%
distribute-lft-neg-in84.9%
Simplified84.9%
Final simplification93.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3300.0)
(+ x y)
(if (<= a -2.65e-263)
x
(if (<= a 9.2e-284)
(/ (* y z) t)
(if (<= a 7.2e-254)
(+ x y)
(if (<= a 1.02e-50) (* (/ y t) (- z a)) (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3300.0) {
tmp = x + y;
} else if (a <= -2.65e-263) {
tmp = x;
} else if (a <= 9.2e-284) {
tmp = (y * z) / t;
} else if (a <= 7.2e-254) {
tmp = x + y;
} else if (a <= 1.02e-50) {
tmp = (y / t) * (z - 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 (a <= (-3300.0d0)) then
tmp = x + y
else if (a <= (-2.65d-263)) then
tmp = x
else if (a <= 9.2d-284) then
tmp = (y * z) / t
else if (a <= 7.2d-254) then
tmp = x + y
else if (a <= 1.02d-50) then
tmp = (y / t) * (z - 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 (a <= -3300.0) {
tmp = x + y;
} else if (a <= -2.65e-263) {
tmp = x;
} else if (a <= 9.2e-284) {
tmp = (y * z) / t;
} else if (a <= 7.2e-254) {
tmp = x + y;
} else if (a <= 1.02e-50) {
tmp = (y / t) * (z - a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3300.0: tmp = x + y elif a <= -2.65e-263: tmp = x elif a <= 9.2e-284: tmp = (y * z) / t elif a <= 7.2e-254: tmp = x + y elif a <= 1.02e-50: tmp = (y / t) * (z - a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3300.0) tmp = Float64(x + y); elseif (a <= -2.65e-263) tmp = x; elseif (a <= 9.2e-284) tmp = Float64(Float64(y * z) / t); elseif (a <= 7.2e-254) tmp = Float64(x + y); elseif (a <= 1.02e-50) tmp = Float64(Float64(y / t) * Float64(z - a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3300.0) tmp = x + y; elseif (a <= -2.65e-263) tmp = x; elseif (a <= 9.2e-284) tmp = (y * z) / t; elseif (a <= 7.2e-254) tmp = x + y; elseif (a <= 1.02e-50) tmp = (y / t) * (z - a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3300.0], N[(x + y), $MachinePrecision], If[LessEqual[a, -2.65e-263], x, If[LessEqual[a, 9.2e-284], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 7.2e-254], N[(x + y), $MachinePrecision], If[LessEqual[a, 1.02e-50], N[(N[(y / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3300:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -2.65 \cdot 10^{-263}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{-284}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-254}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{-50}:\\
\;\;\;\;\frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3300 or 9.2e-284 < a < 7.19999999999999967e-254 or 1.0199999999999999e-50 < a Initial program 81.0%
associate-*l/91.6%
Simplified91.6%
Taylor expanded in a around inf 81.4%
if -3300 < a < -2.6499999999999999e-263Initial program 62.4%
associate-*l/66.0%
Simplified66.0%
Taylor expanded in x around inf 71.0%
if -2.6499999999999999e-263 < a < 9.2e-284Initial program 81.3%
associate-*l/77.7%
Simplified77.7%
Taylor expanded in z around inf 71.5%
Taylor expanded in z around inf 67.9%
mul-1-neg67.9%
*-commutative67.9%
associate-*l/63.9%
distribute-lft-neg-in63.9%
*-commutative63.9%
distribute-neg-frac63.9%
Simplified63.9%
Taylor expanded in a around 0 63.9%
Taylor expanded in y around 0 67.9%
if 7.19999999999999967e-254 < a < 1.0199999999999999e-50Initial program 65.0%
associate-*l/71.9%
Simplified71.9%
Taylor expanded in t around inf 72.8%
sub-neg72.8%
+-commutative72.8%
mul-1-neg72.8%
unsub-neg72.8%
associate-/l*72.8%
mul-1-neg72.8%
remove-double-neg72.8%
associate-/l*82.4%
Simplified82.4%
Taylor expanded in x around 0 46.2%
associate-*l/53.3%
associate-*l/50.8%
distribute-lft-out--53.6%
Simplified53.6%
Final simplification73.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.1e+37) (not (<= a 1.65e-147))) (+ x (+ y (/ (- t z) (/ (- a t) y)))) (- x (/ (* y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.1e+37) || !(a <= 1.65e-147)) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x - ((y * (a - 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 <= (-4.1d+37)) .or. (.not. (a <= 1.65d-147))) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
else
tmp = x - ((y * (a - 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 <= -4.1e+37) || !(a <= 1.65e-147)) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.1e+37) or not (a <= 1.65e-147): tmp = x + (y + ((t - z) / ((a - t) / y))) else: tmp = x - ((y * (a - z)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.1e+37) || !(a <= 1.65e-147)) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); else tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.1e+37) || ~((a <= 1.65e-147))) tmp = x + (y + ((t - z) / ((a - t) / y))); else tmp = x - ((y * (a - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.1e+37], N[Not[LessEqual[a, 1.65e-147]], $MachinePrecision]], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{+37} \lor \neg \left(a \leq 1.65 \cdot 10^{-147}\right):\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\end{array}
\end{array}
if a < -4.0999999999999998e37 or 1.64999999999999994e-147 < a Initial program 81.4%
associate--l+82.8%
associate-/l*92.5%
Simplified92.5%
if -4.0999999999999998e37 < a < 1.64999999999999994e-147Initial program 66.4%
associate-*l/69.7%
Simplified69.7%
Taylor expanded in t around -inf 88.7%
+-commutative88.7%
mul-1-neg88.7%
unsub-neg88.7%
distribute-lft-out--88.7%
Simplified88.7%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.22e+134) (not (<= t 3.15e+153))) (+ (- x (/ y (/ t a))) (/ y (/ t z))) (+ x (+ y (/ (- t z) (/ (- a t) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.22e+134) || !(t <= 3.15e+153)) {
tmp = (x - (y / (t / a))) + (y / (t / z));
} else {
tmp = x + (y + ((t - z) / ((a - t) / 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 ((t <= (-1.22d+134)) .or. (.not. (t <= 3.15d+153))) then
tmp = (x - (y / (t / a))) + (y / (t / z))
else
tmp = x + (y + ((t - z) / ((a - t) / y)))
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.22e+134) || !(t <= 3.15e+153)) {
tmp = (x - (y / (t / a))) + (y / (t / z));
} else {
tmp = x + (y + ((t - z) / ((a - t) / y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.22e+134) or not (t <= 3.15e+153): tmp = (x - (y / (t / a))) + (y / (t / z)) else: tmp = x + (y + ((t - z) / ((a - t) / y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.22e+134) || !(t <= 3.15e+153)) tmp = Float64(Float64(x - Float64(y / Float64(t / a))) + Float64(y / Float64(t / z))); else tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.22e+134) || ~((t <= 3.15e+153))) tmp = (x - (y / (t / a))) + (y / (t / z)); else tmp = x + (y + ((t - z) / ((a - t) / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.22e+134], N[Not[LessEqual[t, 3.15e+153]], $MachinePrecision]], N[(N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{+134} \lor \neg \left(t \leq 3.15 \cdot 10^{+153}\right):\\
\;\;\;\;\left(x - \frac{y}{\frac{t}{a}}\right) + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\end{array}
\end{array}
if t < -1.21999999999999992e134 or 3.1500000000000001e153 < t Initial program 49.6%
associate-*l/60.1%
Simplified60.1%
Taylor expanded in t around inf 88.3%
sub-neg88.3%
+-commutative88.3%
mul-1-neg88.3%
unsub-neg88.3%
associate-/l*89.6%
mul-1-neg89.6%
remove-double-neg89.6%
associate-/l*94.7%
Simplified94.7%
if -1.21999999999999992e134 < t < 3.1500000000000001e153Initial program 84.4%
associate--l+86.5%
associate-/l*90.7%
Simplified90.7%
Final simplification91.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -160000.0)
(+ x y)
(if (<= a -3.3e-267)
x
(if (<= a 2.3e-285)
(/ (* y z) t)
(if (<= a 6e-254) (+ x y) (if (<= a 1e-50) (/ y (/ t z)) (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -160000.0) {
tmp = x + y;
} else if (a <= -3.3e-267) {
tmp = x;
} else if (a <= 2.3e-285) {
tmp = (y * z) / t;
} else if (a <= 6e-254) {
tmp = x + y;
} else if (a <= 1e-50) {
tmp = y / (t / z);
} 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 (a <= (-160000.0d0)) then
tmp = x + y
else if (a <= (-3.3d-267)) then
tmp = x
else if (a <= 2.3d-285) then
tmp = (y * z) / t
else if (a <= 6d-254) then
tmp = x + y
else if (a <= 1d-50) then
tmp = y / (t / z)
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 (a <= -160000.0) {
tmp = x + y;
} else if (a <= -3.3e-267) {
tmp = x;
} else if (a <= 2.3e-285) {
tmp = (y * z) / t;
} else if (a <= 6e-254) {
tmp = x + y;
} else if (a <= 1e-50) {
tmp = y / (t / z);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -160000.0: tmp = x + y elif a <= -3.3e-267: tmp = x elif a <= 2.3e-285: tmp = (y * z) / t elif a <= 6e-254: tmp = x + y elif a <= 1e-50: tmp = y / (t / z) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -160000.0) tmp = Float64(x + y); elseif (a <= -3.3e-267) tmp = x; elseif (a <= 2.3e-285) tmp = Float64(Float64(y * z) / t); elseif (a <= 6e-254) tmp = Float64(x + y); elseif (a <= 1e-50) tmp = Float64(y / Float64(t / z)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -160000.0) tmp = x + y; elseif (a <= -3.3e-267) tmp = x; elseif (a <= 2.3e-285) tmp = (y * z) / t; elseif (a <= 6e-254) tmp = x + y; elseif (a <= 1e-50) tmp = y / (t / z); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -160000.0], N[(x + y), $MachinePrecision], If[LessEqual[a, -3.3e-267], x, If[LessEqual[a, 2.3e-285], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 6e-254], N[(x + y), $MachinePrecision], If[LessEqual[a, 1e-50], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -160000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -3.3 \cdot 10^{-267}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-285}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-254}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 10^{-50}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.6e5 or 2.29999999999999996e-285 < a < 6.00000000000000023e-254 or 1.00000000000000001e-50 < a Initial program 81.0%
associate-*l/91.6%
Simplified91.6%
Taylor expanded in a around inf 81.4%
if -1.6e5 < a < -3.30000000000000004e-267Initial program 62.4%
associate-*l/66.0%
Simplified66.0%
Taylor expanded in x around inf 71.0%
if -3.30000000000000004e-267 < a < 2.29999999999999996e-285Initial program 81.3%
associate-*l/77.7%
Simplified77.7%
Taylor expanded in z around inf 71.5%
Taylor expanded in z around inf 67.9%
mul-1-neg67.9%
*-commutative67.9%
associate-*l/63.9%
distribute-lft-neg-in63.9%
*-commutative63.9%
distribute-neg-frac63.9%
Simplified63.9%
Taylor expanded in a around 0 63.9%
Taylor expanded in y around 0 67.9%
if 6.00000000000000023e-254 < a < 1.00000000000000001e-50Initial program 65.0%
associate-*l/71.9%
Simplified71.9%
Taylor expanded in t around inf 72.8%
sub-neg72.8%
+-commutative72.8%
mul-1-neg72.8%
unsub-neg72.8%
associate-/l*72.8%
mul-1-neg72.8%
remove-double-neg72.8%
associate-/l*82.4%
Simplified82.4%
Taylor expanded in x around 0 46.2%
associate-*l/53.3%
associate-*l/50.8%
distribute-lft-out--53.6%
Simplified53.6%
associate-*l/46.4%
associate-/l*55.6%
Applied egg-rr55.6%
Taylor expanded in z around inf 47.2%
Final simplification72.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (* y (/ z a)))))
(if (<= a -5.2e+38)
t_1
(if (<= a 2.4e-280)
(- x (/ (* y (- a z)) t))
(if (<= a 7200000000.0) (- x (* z (/ y (- a t)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - (y * (z / a));
double tmp;
if (a <= -5.2e+38) {
tmp = t_1;
} else if (a <= 2.4e-280) {
tmp = x - ((y * (a - z)) / t);
} else if (a <= 7200000000.0) {
tmp = x - (z * (y / (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) :: tmp
t_1 = (x + y) - (y * (z / a))
if (a <= (-5.2d+38)) then
tmp = t_1
else if (a <= 2.4d-280) then
tmp = x - ((y * (a - z)) / t)
else if (a <= 7200000000.0d0) then
tmp = x - (z * (y / (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 = (x + y) - (y * (z / a));
double tmp;
if (a <= -5.2e+38) {
tmp = t_1;
} else if (a <= 2.4e-280) {
tmp = x - ((y * (a - z)) / t);
} else if (a <= 7200000000.0) {
tmp = x - (z * (y / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - (y * (z / a)) tmp = 0 if a <= -5.2e+38: tmp = t_1 elif a <= 2.4e-280: tmp = x - ((y * (a - z)) / t) elif a <= 7200000000.0: tmp = x - (z * (y / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(y * Float64(z / a))) tmp = 0.0 if (a <= -5.2e+38) tmp = t_1; elseif (a <= 2.4e-280) tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); elseif (a <= 7200000000.0) tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - (y * (z / a)); tmp = 0.0; if (a <= -5.2e+38) tmp = t_1; elseif (a <= 2.4e-280) tmp = x - ((y * (a - z)) / t); elseif (a <= 7200000000.0) tmp = x - (z * (y / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.2e+38], t$95$1, If[LessEqual[a, 2.4e-280], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7200000000.0], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{if}\;a \leq -5.2 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-280}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\mathbf{elif}\;a \leq 7200000000:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -5.1999999999999998e38 or 7.2e9 < a Initial program 83.2%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in t around 0 94.7%
if -5.1999999999999998e38 < a < 2.3999999999999998e-280Initial program 66.6%
associate-*l/68.9%
Simplified68.9%
Taylor expanded in t around -inf 89.6%
+-commutative89.6%
mul-1-neg89.6%
unsub-neg89.6%
distribute-lft-out--89.6%
Simplified89.6%
if 2.3999999999999998e-280 < a < 7.2e9Initial program 72.1%
associate--l+74.1%
sub-neg74.1%
+-commutative74.1%
associate-/l*75.7%
distribute-neg-frac75.7%
associate-/r/80.1%
fma-def80.1%
sub-neg80.1%
+-commutative80.1%
distribute-neg-in80.1%
unsub-neg80.1%
remove-double-neg80.1%
Simplified80.1%
Taylor expanded in z around inf 78.9%
mul-1-neg78.9%
*-commutative78.9%
associate-*r/85.1%
distribute-lft-neg-in85.1%
Simplified85.1%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.1e+37) (not (<= a 4e-148))) (- (+ x y) (* y (/ z (- a t)))) (- x (/ (* y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.1e+37) || !(a <= 4e-148)) {
tmp = (x + y) - (y * (z / (a - t)));
} else {
tmp = x - ((y * (a - 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 <= (-4.1d+37)) .or. (.not. (a <= 4d-148))) then
tmp = (x + y) - (y * (z / (a - t)))
else
tmp = x - ((y * (a - 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 <= -4.1e+37) || !(a <= 4e-148)) {
tmp = (x + y) - (y * (z / (a - t)));
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.1e+37) or not (a <= 4e-148): tmp = (x + y) - (y * (z / (a - t))) else: tmp = x - ((y * (a - z)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.1e+37) || !(a <= 4e-148)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.1e+37) || ~((a <= 4e-148))) tmp = (x + y) - (y * (z / (a - t))); else tmp = x - ((y * (a - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.1e+37], N[Not[LessEqual[a, 4e-148]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{+37} \lor \neg \left(a \leq 4 \cdot 10^{-148}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\end{array}
\end{array}
if a < -4.0999999999999998e37 or 3.99999999999999974e-148 < a Initial program 81.4%
associate-*l/91.7%
Simplified91.7%
Taylor expanded in z around inf 90.6%
if -4.0999999999999998e37 < a < 3.99999999999999974e-148Initial program 66.4%
associate-*l/69.7%
Simplified69.7%
Taylor expanded in t around -inf 88.7%
+-commutative88.7%
mul-1-neg88.7%
unsub-neg88.7%
distribute-lft-out--88.7%
Simplified88.7%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.1e+37) (not (<= a 3.2e-58))) (- (+ x y) (* y (/ z a))) (- x (/ (* y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.1e+37) || !(a <= 3.2e-58)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x - ((y * (a - 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 <= (-4.1d+37)) .or. (.not. (a <= 3.2d-58))) then
tmp = (x + y) - (y * (z / a))
else
tmp = x - ((y * (a - 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 <= -4.1e+37) || !(a <= 3.2e-58)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.1e+37) or not (a <= 3.2e-58): tmp = (x + y) - (y * (z / a)) else: tmp = x - ((y * (a - z)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.1e+37) || !(a <= 3.2e-58)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.1e+37) || ~((a <= 3.2e-58))) tmp = (x + y) - (y * (z / a)); else tmp = x - ((y * (a - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.1e+37], N[Not[LessEqual[a, 3.2e-58]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{+37} \lor \neg \left(a \leq 3.2 \cdot 10^{-58}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\end{array}
\end{array}
if a < -4.0999999999999998e37 or 3.2000000000000001e-58 < a Initial program 83.5%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in t around 0 91.5%
if -4.0999999999999998e37 < a < 3.2000000000000001e-58Initial program 66.4%
associate-*l/70.0%
Simplified70.0%
Taylor expanded in t around -inf 85.1%
+-commutative85.1%
mul-1-neg85.1%
unsub-neg85.1%
distribute-lft-out--85.1%
Simplified85.1%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.55e+38) (+ x y) (if (<= a 5.8e-56) (- x (/ (* y (- a z)) t)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.55e+38) {
tmp = x + y;
} else if (a <= 5.8e-56) {
tmp = x - ((y * (a - 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 (a <= (-1.55d+38)) then
tmp = x + y
else if (a <= 5.8d-56) then
tmp = x - ((y * (a - 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 (a <= -1.55e+38) {
tmp = x + y;
} else if (a <= 5.8e-56) {
tmp = x - ((y * (a - z)) / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.55e+38: tmp = x + y elif a <= 5.8e-56: tmp = x - ((y * (a - z)) / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.55e+38) tmp = Float64(x + y); elseif (a <= 5.8e-56) tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.55e+38) tmp = x + y; elseif (a <= 5.8e-56) tmp = x - ((y * (a - z)) / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.55e+38], N[(x + y), $MachinePrecision], If[LessEqual[a, 5.8e-56], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+38}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-56}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.55000000000000009e38 or 5.79999999999999982e-56 < a Initial program 83.5%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in a around inf 83.0%
if -1.55000000000000009e38 < a < 5.79999999999999982e-56Initial program 66.4%
associate-*l/70.0%
Simplified70.0%
Taylor expanded in t around -inf 85.1%
+-commutative85.1%
mul-1-neg85.1%
unsub-neg85.1%
distribute-lft-out--85.1%
Simplified85.1%
Final simplification84.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -360000.0) (+ x y) (if (<= a -4.8e-267) x (if (<= a 1.6e-50) (* y (/ z t)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -360000.0) {
tmp = x + y;
} else if (a <= -4.8e-267) {
tmp = x;
} else if (a <= 1.6e-50) {
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 (a <= (-360000.0d0)) then
tmp = x + y
else if (a <= (-4.8d-267)) then
tmp = x
else if (a <= 1.6d-50) 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 (a <= -360000.0) {
tmp = x + y;
} else if (a <= -4.8e-267) {
tmp = x;
} else if (a <= 1.6e-50) {
tmp = y * (z / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -360000.0: tmp = x + y elif a <= -4.8e-267: tmp = x elif a <= 1.6e-50: tmp = y * (z / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -360000.0) tmp = Float64(x + y); elseif (a <= -4.8e-267) tmp = x; elseif (a <= 1.6e-50) 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 (a <= -360000.0) tmp = x + y; elseif (a <= -4.8e-267) tmp = x; elseif (a <= 1.6e-50) tmp = y * (z / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -360000.0], N[(x + y), $MachinePrecision], If[LessEqual[a, -4.8e-267], x, If[LessEqual[a, 1.6e-50], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -360000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -4.8 \cdot 10^{-267}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-50}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3.6e5 or 1.6e-50 < a Initial program 82.2%
associate-*l/93.3%
Simplified93.3%
Taylor expanded in a around inf 82.5%
if -3.6e5 < a < -4.7999999999999996e-267Initial program 62.4%
associate-*l/66.0%
Simplified66.0%
Taylor expanded in x around inf 71.0%
if -4.7999999999999996e-267 < a < 1.6e-50Initial program 70.3%
associate-*l/72.9%
Simplified72.9%
Taylor expanded in z around inf 68.9%
Taylor expanded in z around inf 52.1%
mul-1-neg52.1%
*-commutative52.1%
associate-*l/55.0%
distribute-lft-neg-in55.0%
*-commutative55.0%
distribute-neg-frac55.0%
Simplified55.0%
Taylor expanded in a around 0 49.9%
Final simplification70.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -245000000.0) (+ x y) (if (<= a 9e-39) (+ x (* z (/ y t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -245000000.0) {
tmp = x + y;
} else if (a <= 9e-39) {
tmp = x + (z * (y / 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 (a <= (-245000000.0d0)) then
tmp = x + y
else if (a <= 9d-39) then
tmp = x + (z * (y / 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 (a <= -245000000.0) {
tmp = x + y;
} else if (a <= 9e-39) {
tmp = x + (z * (y / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -245000000.0: tmp = x + y elif a <= 9e-39: tmp = x + (z * (y / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -245000000.0) tmp = Float64(x + y); elseif (a <= 9e-39) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -245000000.0) tmp = x + y; elseif (a <= 9e-39) tmp = x + (z * (y / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -245000000.0], N[(x + y), $MachinePrecision], If[LessEqual[a, 9e-39], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -245000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-39}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -2.45e8 or 9.0000000000000002e-39 < a Initial program 82.2%
associate-*l/93.3%
Simplified93.3%
Taylor expanded in a around inf 82.5%
if -2.45e8 < a < 9.0000000000000002e-39Initial program 66.8%
associate-*l/69.8%
Simplified69.8%
Taylor expanded in t around inf 85.0%
sub-neg85.0%
+-commutative85.0%
mul-1-neg85.0%
unsub-neg85.0%
associate-/l*85.0%
mul-1-neg85.0%
remove-double-neg85.0%
associate-/l*87.8%
Simplified87.8%
Taylor expanded in a around 0 79.4%
associate-*l/78.7%
+-commutative78.7%
*-commutative78.7%
Simplified78.7%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -3700.0) (+ x y) (if (<= a 4.2e-58) (+ x (/ (* y z) t)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3700.0) {
tmp = x + y;
} else if (a <= 4.2e-58) {
tmp = x + ((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 (a <= (-3700.0d0)) then
tmp = x + y
else if (a <= 4.2d-58) then
tmp = x + ((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 (a <= -3700.0) {
tmp = x + y;
} else if (a <= 4.2e-58) {
tmp = x + ((y * z) / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3700.0: tmp = x + y elif a <= 4.2e-58: tmp = x + ((y * z) / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3700.0) tmp = Float64(x + y); elseif (a <= 4.2e-58) tmp = Float64(x + Float64(Float64(y * z) / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3700.0) tmp = x + y; elseif (a <= 4.2e-58) tmp = x + ((y * z) / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3700.0], N[(x + y), $MachinePrecision], If[LessEqual[a, 4.2e-58], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3700:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-58}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3700 or 4.19999999999999975e-58 < a Initial program 81.7%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in a around inf 82.0%
if -3700 < a < 4.19999999999999975e-58Initial program 67.0%
associate-*l/70.1%
Simplified70.1%
Taylor expanded in t around inf 85.5%
sub-neg85.5%
+-commutative85.5%
mul-1-neg85.5%
unsub-neg85.5%
associate-/l*85.5%
mul-1-neg85.5%
remove-double-neg85.5%
associate-/l*87.7%
Simplified87.7%
Taylor expanded in a around 0 79.9%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1850.0) (+ x y) (if (<= a 2.6e-165) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1850.0) {
tmp = x + y;
} else if (a <= 2.6e-165) {
tmp = x;
} 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 (a <= (-1850.0d0)) then
tmp = x + y
else if (a <= 2.6d-165) then
tmp = x
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 (a <= -1850.0) {
tmp = x + y;
} else if (a <= 2.6e-165) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1850.0: tmp = x + y elif a <= 2.6e-165: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1850.0) tmp = Float64(x + y); elseif (a <= 2.6e-165) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1850.0) tmp = x + y; elseif (a <= 2.6e-165) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1850.0], N[(x + y), $MachinePrecision], If[LessEqual[a, 2.6e-165], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1850:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-165}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1850 or 2.60000000000000007e-165 < a Initial program 79.1%
associate-*l/89.2%
Simplified89.2%
Taylor expanded in a around inf 74.3%
if -1850 < a < 2.60000000000000007e-165Initial program 67.8%
associate-*l/70.6%
Simplified70.6%
Taylor expanded in x around inf 56.6%
Final simplification67.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 74.5%
associate-*l/81.6%
Simplified81.6%
Taylor expanded in x around inf 51.9%
Final simplification51.9%
(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 2023196
(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))))