
(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 14 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 (+ (+ y x) (/ (* y (- t z)) (- a t)))))
(if (or (<= t_1 -1e-220) (not (<= t_1 0.0)))
(+ x (+ y (/ (- t z) (/ (- a t) y))))
(+ x (/ (- z a) (/ t y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -1e-220) || !(t_1 <= 0.0)) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x + ((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) :: t_1
real(8) :: tmp
t_1 = (y + x) + ((y * (t - z)) / (a - t))
if ((t_1 <= (-1d-220)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
else
tmp = x + ((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 t_1 = (y + x) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -1e-220) || !(t_1 <= 0.0)) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x + ((z - a) / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) + ((y * (t - z)) / (a - t)) tmp = 0 if (t_1 <= -1e-220) or not (t_1 <= 0.0): tmp = x + (y + ((t - z) / ((a - t) / y))) else: tmp = x + ((z - a) / (t / y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -1e-220) || !(t_1 <= 0.0)) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); else tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) + ((y * (t - z)) / (a - t)); tmp = 0.0; if ((t_1 <= -1e-220) || ~((t_1 <= 0.0))) tmp = x + (y + ((t - z) / ((a - t) / y))); else tmp = x + ((z - a) / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-220], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-220} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -9.99999999999999992e-221 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 86.9%
associate--l+86.9%
associate-/l*95.7%
Simplified95.7%
if -9.99999999999999992e-221 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.2%
associate--l+39.3%
associate-/l*22.6%
Simplified22.6%
Taylor expanded in t around -inf 99.5%
+-commutative99.5%
sub-neg99.5%
mul-1-neg99.5%
+-commutative99.5%
*-commutative99.5%
+-commutative99.5%
*-commutative99.5%
mul-1-neg99.5%
unsub-neg99.5%
mul-1-neg99.5%
sub-neg99.5%
distribute-lft-out--99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
neg-mul-199.5%
+-commutative99.5%
sub-neg99.5%
sub-neg99.5%
mul-1-neg99.5%
+-commutative99.5%
*-commutative99.5%
associate-/l*99.8%
+-commutative99.8%
mul-1-neg99.8%
sub-neg99.8%
Simplified99.8%
Final simplification95.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ y (- x (/ y (/ a z))))))
(if (<= a -4.5e+33)
t_1
(if (<= a -9.5)
(+ x (/ (* y (- z a)) t))
(if (or (<= a -1.8e-54) (not (<= a 2.7e+61)))
t_1
(- x (/ y (/ (- a t) z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y + (x - (y / (a / z)));
double tmp;
if (a <= -4.5e+33) {
tmp = t_1;
} else if (a <= -9.5) {
tmp = x + ((y * (z - a)) / t);
} else if ((a <= -1.8e-54) || !(a <= 2.7e+61)) {
tmp = t_1;
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y + (x - (y / (a / z)))
if (a <= (-4.5d+33)) then
tmp = t_1
else if (a <= (-9.5d0)) then
tmp = x + ((y * (z - a)) / t)
else if ((a <= (-1.8d-54)) .or. (.not. (a <= 2.7d+61))) then
tmp = t_1
else
tmp = x - (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y + (x - (y / (a / z)));
double tmp;
if (a <= -4.5e+33) {
tmp = t_1;
} else if (a <= -9.5) {
tmp = x + ((y * (z - a)) / t);
} else if ((a <= -1.8e-54) || !(a <= 2.7e+61)) {
tmp = t_1;
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y + (x - (y / (a / z))) tmp = 0 if a <= -4.5e+33: tmp = t_1 elif a <= -9.5: tmp = x + ((y * (z - a)) / t) elif (a <= -1.8e-54) or not (a <= 2.7e+61): tmp = t_1 else: tmp = x - (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(y + Float64(x - Float64(y / Float64(a / z)))) tmp = 0.0 if (a <= -4.5e+33) tmp = t_1; elseif (a <= -9.5) tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); elseif ((a <= -1.8e-54) || !(a <= 2.7e+61)) tmp = t_1; else tmp = Float64(x - Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y + (x - (y / (a / z))); tmp = 0.0; if (a <= -4.5e+33) tmp = t_1; elseif (a <= -9.5) tmp = x + ((y * (z - a)) / t); elseif ((a <= -1.8e-54) || ~((a <= 2.7e+61))) tmp = t_1; else tmp = x - (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.5e+33], t$95$1, If[LessEqual[a, -9.5], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -1.8e-54], N[Not[LessEqual[a, 2.7e+61]], $MachinePrecision]], t$95$1, N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{if}\;a \leq -4.5 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -9.5:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\mathbf{elif}\;a \leq -1.8 \cdot 10^{-54} \lor \neg \left(a \leq 2.7 \cdot 10^{+61}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if a < -4.5e33 or -9.5 < a < -1.79999999999999988e-54 or 2.7000000000000002e61 < a Initial program 84.2%
associate--l+84.8%
sub-neg84.8%
+-commutative84.8%
associate-/l*95.7%
distribute-neg-frac95.7%
associate-/r/96.4%
fma-def96.3%
sub-neg96.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
remove-double-neg96.3%
Simplified96.3%
Taylor expanded in t around 0 87.3%
mul-1-neg87.3%
sub-neg87.3%
associate-/l*93.5%
Simplified93.5%
if -4.5e33 < a < -9.5Initial program 19.6%
associate--l+34.7%
associate-/l*35.6%
Simplified35.6%
Taylor expanded in t around -inf 98.6%
+-commutative98.6%
sub-neg98.6%
mul-1-neg98.6%
+-commutative98.6%
*-commutative98.6%
+-commutative98.6%
*-commutative98.6%
mul-1-neg98.6%
unsub-neg98.6%
mul-1-neg98.6%
sub-neg98.6%
distribute-lft-out--98.6%
Simplified98.6%
if -1.79999999999999988e-54 < a < 2.7000000000000002e61Initial program 82.7%
associate--l+85.8%
sub-neg85.8%
+-commutative85.8%
associate-/l*89.0%
distribute-neg-frac89.0%
associate-/r/90.3%
fma-def90.3%
sub-neg90.3%
+-commutative90.3%
distribute-neg-in90.3%
unsub-neg90.3%
remove-double-neg90.3%
Simplified90.3%
Taylor expanded in z around inf 90.3%
associate-*r/90.3%
associate-*r*90.3%
neg-mul-190.3%
Simplified90.3%
Taylor expanded in x around 0 90.3%
mul-1-neg90.3%
unsub-neg90.3%
associate-/l*93.0%
Simplified93.0%
Final simplification93.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ y (- x (/ y (/ a z))))))
(if (<= a -1.6e+37)
t_1
(if (<= a -9.8e-5)
(+ x (/ (- z a) (/ t y)))
(if (or (<= a -6e-54) (not (<= a 3.5e+59)))
t_1
(- x (/ y (/ (- a t) z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y + (x - (y / (a / z)));
double tmp;
if (a <= -1.6e+37) {
tmp = t_1;
} else if (a <= -9.8e-5) {
tmp = x + ((z - a) / (t / y));
} else if ((a <= -6e-54) || !(a <= 3.5e+59)) {
tmp = t_1;
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y + (x - (y / (a / z)))
if (a <= (-1.6d+37)) then
tmp = t_1
else if (a <= (-9.8d-5)) then
tmp = x + ((z - a) / (t / y))
else if ((a <= (-6d-54)) .or. (.not. (a <= 3.5d+59))) then
tmp = t_1
else
tmp = x - (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y + (x - (y / (a / z)));
double tmp;
if (a <= -1.6e+37) {
tmp = t_1;
} else if (a <= -9.8e-5) {
tmp = x + ((z - a) / (t / y));
} else if ((a <= -6e-54) || !(a <= 3.5e+59)) {
tmp = t_1;
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y + (x - (y / (a / z))) tmp = 0 if a <= -1.6e+37: tmp = t_1 elif a <= -9.8e-5: tmp = x + ((z - a) / (t / y)) elif (a <= -6e-54) or not (a <= 3.5e+59): tmp = t_1 else: tmp = x - (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(y + Float64(x - Float64(y / Float64(a / z)))) tmp = 0.0 if (a <= -1.6e+37) tmp = t_1; elseif (a <= -9.8e-5) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); elseif ((a <= -6e-54) || !(a <= 3.5e+59)) tmp = t_1; else tmp = Float64(x - Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y + (x - (y / (a / z))); tmp = 0.0; if (a <= -1.6e+37) tmp = t_1; elseif (a <= -9.8e-5) tmp = x + ((z - a) / (t / y)); elseif ((a <= -6e-54) || ~((a <= 3.5e+59))) tmp = t_1; else tmp = x - (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.6e+37], t$95$1, If[LessEqual[a, -9.8e-5], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -6e-54], N[Not[LessEqual[a, 3.5e+59]], $MachinePrecision]], t$95$1, N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{if}\;a \leq -1.6 \cdot 10^{+37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -9.8 \cdot 10^{-5}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-54} \lor \neg \left(a \leq 3.5 \cdot 10^{+59}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if a < -1.60000000000000007e37 or -9.8e-5 < a < -6.00000000000000018e-54 or 3.5e59 < a Initial program 84.2%
associate--l+84.8%
sub-neg84.8%
+-commutative84.8%
associate-/l*95.7%
distribute-neg-frac95.7%
associate-/r/96.4%
fma-def96.3%
sub-neg96.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
remove-double-neg96.3%
Simplified96.3%
Taylor expanded in t around 0 87.3%
mul-1-neg87.3%
sub-neg87.3%
associate-/l*93.5%
Simplified93.5%
if -1.60000000000000007e37 < a < -9.8e-5Initial program 19.6%
associate--l+34.7%
associate-/l*35.6%
Simplified35.6%
Taylor expanded in t around -inf 98.6%
+-commutative98.6%
sub-neg98.6%
mul-1-neg98.6%
+-commutative98.6%
*-commutative98.6%
+-commutative98.6%
*-commutative98.6%
mul-1-neg98.6%
unsub-neg98.6%
mul-1-neg98.6%
sub-neg98.6%
distribute-lft-out--98.6%
Simplified98.6%
Taylor expanded in x around 0 98.6%
neg-mul-198.6%
+-commutative98.6%
sub-neg98.6%
sub-neg98.6%
mul-1-neg98.6%
+-commutative98.6%
*-commutative98.6%
associate-/l*98.9%
+-commutative98.9%
mul-1-neg98.9%
sub-neg98.9%
Simplified98.9%
if -6.00000000000000018e-54 < a < 3.5e59Initial program 82.7%
associate--l+85.8%
sub-neg85.8%
+-commutative85.8%
associate-/l*89.0%
distribute-neg-frac89.0%
associate-/r/90.3%
fma-def90.3%
sub-neg90.3%
+-commutative90.3%
distribute-neg-in90.3%
unsub-neg90.3%
remove-double-neg90.3%
Simplified90.3%
Taylor expanded in z around inf 90.3%
associate-*r/90.3%
associate-*r*90.3%
neg-mul-190.3%
Simplified90.3%
Taylor expanded in x around 0 90.3%
mul-1-neg90.3%
unsub-neg90.3%
associate-/l*93.0%
Simplified93.0%
Final simplification93.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.5e+33)
(- (+ y x) (* y (/ z a)))
(if (<= a -0.0039)
(+ x (/ (- z a) (/ t y)))
(if (or (<= a -7e-54) (not (<= a 1e+61)))
(+ y (- x (/ y (/ a z))))
(- x (/ y (/ (- a t) z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.5e+33) {
tmp = (y + x) - (y * (z / a));
} else if (a <= -0.0039) {
tmp = x + ((z - a) / (t / y));
} else if ((a <= -7e-54) || !(a <= 1e+61)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.5d+33)) then
tmp = (y + x) - (y * (z / a))
else if (a <= (-0.0039d0)) then
tmp = x + ((z - a) / (t / y))
else if ((a <= (-7d-54)) .or. (.not. (a <= 1d+61))) then
tmp = y + (x - (y / (a / z)))
else
tmp = x - (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.5e+33) {
tmp = (y + x) - (y * (z / a));
} else if (a <= -0.0039) {
tmp = x + ((z - a) / (t / y));
} else if ((a <= -7e-54) || !(a <= 1e+61)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.5e+33: tmp = (y + x) - (y * (z / a)) elif a <= -0.0039: tmp = x + ((z - a) / (t / y)) elif (a <= -7e-54) or not (a <= 1e+61): tmp = y + (x - (y / (a / z))) else: tmp = x - (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.5e+33) tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); elseif (a <= -0.0039) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); elseif ((a <= -7e-54) || !(a <= 1e+61)) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); else tmp = Float64(x - Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.5e+33) tmp = (y + x) - (y * (z / a)); elseif (a <= -0.0039) tmp = x + ((z - a) / (t / y)); elseif ((a <= -7e-54) || ~((a <= 1e+61))) tmp = y + (x - (y / (a / z))); else tmp = x - (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.5e+33], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -0.0039], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -7e-54], N[Not[LessEqual[a, 1e+61]], $MachinePrecision]], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+33}:\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq -0.0039:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{elif}\;a \leq -7 \cdot 10^{-54} \lor \neg \left(a \leq 10^{+61}\right):\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if a < -2.49999999999999986e33Initial program 87.1%
associate-*l/95.6%
Simplified95.6%
Taylor expanded in t around 0 93.3%
if -2.49999999999999986e33 < a < -0.0038999999999999998Initial program 19.6%
associate--l+34.7%
associate-/l*35.6%
Simplified35.6%
Taylor expanded in t around -inf 98.6%
+-commutative98.6%
sub-neg98.6%
mul-1-neg98.6%
+-commutative98.6%
*-commutative98.6%
+-commutative98.6%
*-commutative98.6%
mul-1-neg98.6%
unsub-neg98.6%
mul-1-neg98.6%
sub-neg98.6%
distribute-lft-out--98.6%
Simplified98.6%
Taylor expanded in x around 0 98.6%
neg-mul-198.6%
+-commutative98.6%
sub-neg98.6%
sub-neg98.6%
mul-1-neg98.6%
+-commutative98.6%
*-commutative98.6%
associate-/l*98.9%
+-commutative98.9%
mul-1-neg98.9%
sub-neg98.9%
Simplified98.9%
if -0.0038999999999999998 < a < -6.99999999999999964e-54 or 9.99999999999999949e60 < a Initial program 81.6%
associate--l+82.9%
sub-neg82.9%
+-commutative82.9%
associate-/l*95.8%
distribute-neg-frac95.8%
associate-/r/95.7%
fma-def95.7%
sub-neg95.7%
+-commutative95.7%
distribute-neg-in95.7%
unsub-neg95.7%
remove-double-neg95.7%
Simplified95.7%
Taylor expanded in t around 0 85.8%
mul-1-neg85.8%
sub-neg85.8%
associate-/l*93.7%
Simplified93.7%
if -6.99999999999999964e-54 < a < 9.99999999999999949e60Initial program 82.7%
associate--l+85.8%
sub-neg85.8%
+-commutative85.8%
associate-/l*89.0%
distribute-neg-frac89.0%
associate-/r/90.3%
fma-def90.3%
sub-neg90.3%
+-commutative90.3%
distribute-neg-in90.3%
unsub-neg90.3%
remove-double-neg90.3%
Simplified90.3%
Taylor expanded in z around inf 90.3%
associate-*r/90.3%
associate-*r*90.3%
neg-mul-190.3%
Simplified90.3%
Taylor expanded in x around 0 90.3%
mul-1-neg90.3%
unsub-neg90.3%
associate-/l*93.0%
Simplified93.0%
Final simplification93.4%
(FPCore (x y z t a) :precision binary64 (- x (* y (- (/ z (- a t)) (+ (/ t (- a t)) 1.0)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((z / (a - t)) - ((t / (a - t)) + 1.0)));
}
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 / (a - t)) - ((t / (a - t)) + 1.0d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((z / (a - t)) - ((t / (a - t)) + 1.0)));
}
def code(x, y, z, t, a): return x - (y * ((z / (a - t)) - ((t / (a - t)) + 1.0)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(z / Float64(a - t)) - Float64(Float64(t / Float64(a - t)) + 1.0)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((z / (a - t)) - ((t / (a - t)) + 1.0))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] - N[(N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \left(\frac{z}{a - t} - \left(\frac{t}{a - t} + 1\right)\right)
\end{array}
Initial program 82.0%
associate--l+84.1%
sub-neg84.1%
+-commutative84.1%
associate-/l*91.4%
distribute-neg-frac91.4%
associate-/r/92.7%
fma-def92.7%
sub-neg92.7%
+-commutative92.7%
distribute-neg-in92.7%
unsub-neg92.7%
remove-double-neg92.7%
Simplified92.7%
Taylor expanded in y around 0 95.1%
Final simplification95.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.9e-64) (not (<= a 1.42e-98))) (+ y (- x (/ y (/ a z)))) (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.9e-64) || !(a <= 1.42e-98)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.9d-64)) .or. (.not. (a <= 1.42d-98))) then
tmp = y + (x - (y / (a / z)))
else
tmp = x + (y / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.9e-64) || !(a <= 1.42e-98)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.9e-64) or not (a <= 1.42e-98): tmp = y + (x - (y / (a / z))) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.9e-64) || !(a <= 1.42e-98)) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.9e-64) || ~((a <= 1.42e-98))) tmp = y + (x - (y / (a / z))); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.9e-64], N[Not[LessEqual[a, 1.42e-98]], $MachinePrecision]], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{-64} \lor \neg \left(a \leq 1.42 \cdot 10^{-98}\right):\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if a < -2.8999999999999999e-64 or 1.41999999999999999e-98 < a Initial program 82.2%
associate--l+83.6%
sub-neg83.6%
+-commutative83.6%
associate-/l*93.0%
distribute-neg-frac93.0%
associate-/r/94.5%
fma-def94.4%
sub-neg94.4%
+-commutative94.4%
distribute-neg-in94.4%
unsub-neg94.4%
remove-double-neg94.4%
Simplified94.4%
Taylor expanded in t around 0 83.3%
mul-1-neg83.3%
sub-neg83.3%
associate-/l*88.3%
Simplified88.3%
if -2.8999999999999999e-64 < a < 1.41999999999999999e-98Initial program 81.7%
associate--l+85.2%
sub-neg85.2%
+-commutative85.2%
associate-/l*88.0%
distribute-neg-frac88.0%
associate-/r/89.0%
fma-def89.0%
sub-neg89.0%
+-commutative89.0%
distribute-neg-in89.0%
unsub-neg89.0%
remove-double-neg89.0%
Simplified89.0%
Taylor expanded in y around 0 94.4%
Taylor expanded in a around 0 78.0%
associate-/l*81.8%
Simplified81.8%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.6e-54) (not (<= a 2.45e+61))) (+ y (- x (/ y (/ a z)))) (- x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.6e-54) || !(a <= 2.45e+61)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3.6d-54)) .or. (.not. (a <= 2.45d+61))) then
tmp = y + (x - (y / (a / z)))
else
tmp = x - (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.6e-54) || !(a <= 2.45e+61)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.6e-54) or not (a <= 2.45e+61): tmp = y + (x - (y / (a / z))) else: tmp = x - (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.6e-54) || !(a <= 2.45e+61)) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); else tmp = Float64(x - Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.6e-54) || ~((a <= 2.45e+61))) tmp = y + (x - (y / (a / z))); else tmp = x - (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.6e-54], N[Not[LessEqual[a, 2.45e+61]], $MachinePrecision]], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.6 \cdot 10^{-54} \lor \neg \left(a \leq 2.45 \cdot 10^{+61}\right):\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if a < -3.59999999999999976e-54 or 2.45000000000000013e61 < a Initial program 81.5%
associate--l+82.8%
sub-neg82.8%
+-commutative82.8%
associate-/l*93.2%
distribute-neg-frac93.2%
associate-/r/94.5%
fma-def94.5%
sub-neg94.5%
+-commutative94.5%
distribute-neg-in94.5%
unsub-neg94.5%
remove-double-neg94.5%
Simplified94.5%
Taylor expanded in t around 0 84.6%
mul-1-neg84.6%
sub-neg84.6%
associate-/l*90.5%
Simplified90.5%
if -3.59999999999999976e-54 < a < 2.45000000000000013e61Initial program 82.7%
associate--l+85.8%
sub-neg85.8%
+-commutative85.8%
associate-/l*89.0%
distribute-neg-frac89.0%
associate-/r/90.3%
fma-def90.3%
sub-neg90.3%
+-commutative90.3%
distribute-neg-in90.3%
unsub-neg90.3%
remove-double-neg90.3%
Simplified90.3%
Taylor expanded in z around inf 90.3%
associate-*r/90.3%
associate-*r*90.3%
neg-mul-190.3%
Simplified90.3%
Taylor expanded in x around 0 90.3%
mul-1-neg90.3%
unsub-neg90.3%
associate-/l*93.0%
Simplified93.0%
Final simplification91.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y t))))
(if (<= z -5.4e+165)
t_1
(if (<= z 8.8e+266) (+ y x) (if (<= z 5e+304) t_1 x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / t);
double tmp;
if (z <= -5.4e+165) {
tmp = t_1;
} else if (z <= 8.8e+266) {
tmp = y + x;
} else if (z <= 5e+304) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = z * (y / t)
if (z <= (-5.4d+165)) then
tmp = t_1
else if (z <= 8.8d+266) then
tmp = y + x
else if (z <= 5d+304) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / t);
double tmp;
if (z <= -5.4e+165) {
tmp = t_1;
} else if (z <= 8.8e+266) {
tmp = y + x;
} else if (z <= 5e+304) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / t) tmp = 0 if z <= -5.4e+165: tmp = t_1 elif z <= 8.8e+266: tmp = y + x elif z <= 5e+304: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / t)) tmp = 0.0 if (z <= -5.4e+165) tmp = t_1; elseif (z <= 8.8e+266) tmp = Float64(y + x); elseif (z <= 5e+304) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / t); tmp = 0.0; if (z <= -5.4e+165) tmp = t_1; elseif (z <= 8.8e+266) tmp = y + x; elseif (z <= 5e+304) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4e+165], t$95$1, If[LessEqual[z, 8.8e+266], N[(y + x), $MachinePrecision], If[LessEqual[z, 5e+304], t$95$1, x]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{t}\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{+165}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+266}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.3999999999999999e165 or 8.7999999999999996e266 < z < 4.9999999999999997e304Initial program 80.8%
associate--l+80.8%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in t around -inf 54.5%
+-commutative54.5%
sub-neg54.5%
mul-1-neg54.5%
+-commutative54.5%
*-commutative54.5%
+-commutative54.5%
*-commutative54.5%
mul-1-neg54.5%
unsub-neg54.5%
mul-1-neg54.5%
sub-neg54.5%
distribute-lft-out--54.5%
Simplified54.5%
Taylor expanded in x around 0 54.5%
neg-mul-154.5%
+-commutative54.5%
sub-neg54.5%
sub-neg54.5%
mul-1-neg54.5%
+-commutative54.5%
*-commutative54.5%
associate-/l*65.2%
+-commutative65.2%
mul-1-neg65.2%
sub-neg65.2%
Simplified65.2%
Taylor expanded in z around inf 40.3%
associate-/l*48.1%
Simplified48.1%
associate-/r/51.1%
Applied egg-rr51.1%
if -5.3999999999999999e165 < z < 8.7999999999999996e266Initial program 82.1%
associate--l+84.5%
sub-neg84.5%
+-commutative84.5%
associate-/l*90.3%
distribute-neg-frac90.3%
associate-/r/92.2%
fma-def92.2%
sub-neg92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
remove-double-neg92.2%
Simplified92.2%
Taylor expanded in a around inf 69.2%
if 4.9999999999999997e304 < z Initial program 100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
associate-/l*100.0%
distribute-neg-frac100.0%
associate-/r/100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Final simplification66.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.5e+74) (+ y x) (if (<= a 550000000000.0) (+ x (/ y (/ t z))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.5e+74) {
tmp = y + x;
} else if (a <= 550000000000.0) {
tmp = x + (y / (t / z));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.5d+74)) then
tmp = y + x
else if (a <= 550000000000.0d0) then
tmp = x + (y / (t / z))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.5e+74) {
tmp = y + x;
} else if (a <= 550000000000.0) {
tmp = x + (y / (t / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.5e+74: tmp = y + x elif a <= 550000000000.0: tmp = x + (y / (t / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.5e+74) tmp = Float64(y + x); elseif (a <= 550000000000.0) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.5e+74) tmp = y + x; elseif (a <= 550000000000.0) tmp = x + (y / (t / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.5e+74], N[(y + x), $MachinePrecision], If[LessEqual[a, 550000000000.0], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{+74}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 550000000000:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1.5e74 or 5.5e11 < a Initial program 83.5%
associate--l+84.3%
sub-neg84.3%
+-commutative84.3%
associate-/l*97.5%
distribute-neg-frac97.5%
associate-/r/97.6%
fma-def97.5%
sub-neg97.5%
+-commutative97.5%
distribute-neg-in97.5%
unsub-neg97.5%
remove-double-neg97.5%
Simplified97.5%
Taylor expanded in a around inf 84.4%
if -1.5e74 < a < 5.5e11Initial program 80.5%
associate--l+83.9%
sub-neg83.9%
+-commutative83.9%
associate-/l*85.3%
distribute-neg-frac85.3%
associate-/r/87.9%
fma-def87.9%
sub-neg87.9%
+-commutative87.9%
distribute-neg-in87.9%
unsub-neg87.9%
remove-double-neg87.9%
Simplified87.9%
Taylor expanded in y around 0 92.6%
Taylor expanded in a around 0 73.4%
associate-/l*75.8%
Simplified75.8%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.65e+165) (not (<= z 4.4e+256))) (* y (/ (- z) a)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.65e+165) || !(z <= 4.4e+256)) {
tmp = y * (-z / a);
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.65d+165)) .or. (.not. (z <= 4.4d+256))) then
tmp = y * (-z / a)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.65e+165) || !(z <= 4.4e+256)) {
tmp = y * (-z / a);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.65e+165) or not (z <= 4.4e+256): tmp = y * (-z / a) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.65e+165) || !(z <= 4.4e+256)) tmp = Float64(y * Float64(Float64(-z) / a)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.65e+165) || ~((z <= 4.4e+256))) tmp = y * (-z / a); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.65e+165], N[Not[LessEqual[z, 4.4e+256]], $MachinePrecision]], N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.65 \cdot 10^{+165} \lor \neg \left(z \leq 4.4 \cdot 10^{+256}\right):\\
\;\;\;\;y \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -3.6500000000000001e165 or 4.3999999999999999e256 < z Initial program 82.4%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in t around 0 69.8%
Taylor expanded in z around inf 51.7%
mul-1-neg51.7%
*-commutative51.7%
associate-*l/57.0%
distribute-lft-neg-in57.0%
*-commutative57.0%
distribute-neg-frac57.0%
Simplified57.0%
if -3.6500000000000001e165 < z < 4.3999999999999999e256Initial program 82.0%
associate--l+84.4%
sub-neg84.4%
+-commutative84.4%
associate-/l*90.2%
distribute-neg-frac90.2%
associate-/r/92.2%
fma-def92.2%
sub-neg92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
remove-double-neg92.2%
Simplified92.2%
Taylor expanded in a around inf 69.8%
Final simplification68.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.65e+165) (not (<= z 6.4e+256))) (* z (/ (- y) a)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.65e+165) || !(z <= 6.4e+256)) {
tmp = z * (-y / a);
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.65d+165)) .or. (.not. (z <= 6.4d+256))) then
tmp = z * (-y / a)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.65e+165) || !(z <= 6.4e+256)) {
tmp = z * (-y / a);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.65e+165) or not (z <= 6.4e+256): tmp = z * (-y / a) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.65e+165) || !(z <= 6.4e+256)) tmp = Float64(z * Float64(Float64(-y) / a)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.65e+165) || ~((z <= 6.4e+256))) tmp = z * (-y / a); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.65e+165], N[Not[LessEqual[z, 6.4e+256]], $MachinePrecision]], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+165} \lor \neg \left(z \leq 6.4 \cdot 10^{+256}\right):\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.6499999999999999e165 or 6.39999999999999993e256 < z Initial program 82.4%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in t around 0 69.8%
Taylor expanded in z around inf 51.7%
mul-1-neg51.7%
associate-/l*57.0%
associate-/r/57.1%
distribute-rgt-neg-in57.1%
Simplified57.1%
if -1.6499999999999999e165 < z < 6.39999999999999993e256Initial program 82.0%
associate--l+84.4%
sub-neg84.4%
+-commutative84.4%
associate-/l*90.2%
distribute-neg-frac90.2%
associate-/r/92.2%
fma-def92.2%
sub-neg92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
remove-double-neg92.2%
Simplified92.2%
Taylor expanded in a around inf 69.8%
Final simplification68.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.4e+165) (* y (/ z t)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.4e+165) {
tmp = y * (z / t);
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.4d+165)) then
tmp = y * (z / t)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.4e+165) {
tmp = y * (z / t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.4e+165: tmp = y * (z / t) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.4e+165) tmp = Float64(y * Float64(z / t)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.4e+165) tmp = y * (z / t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.4e+165], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+165}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -5.3999999999999999e165Initial program 85.0%
associate--l+85.0%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in t around -inf 61.4%
+-commutative61.4%
sub-neg61.4%
mul-1-neg61.4%
+-commutative61.4%
*-commutative61.4%
+-commutative61.4%
*-commutative61.4%
mul-1-neg61.4%
unsub-neg61.4%
mul-1-neg61.4%
sub-neg61.4%
distribute-lft-out--61.4%
Simplified61.4%
Taylor expanded in x around 0 61.4%
neg-mul-161.4%
+-commutative61.4%
sub-neg61.4%
sub-neg61.4%
mul-1-neg61.4%
+-commutative61.4%
*-commutative61.4%
associate-/l*68.7%
+-commutative68.7%
mul-1-neg68.7%
sub-neg68.7%
Simplified68.7%
Taylor expanded in z around inf 42.1%
associate-/l*49.3%
Simplified49.3%
Taylor expanded in y around 0 42.1%
associate-*r/49.4%
Simplified49.4%
if -5.3999999999999999e165 < z Initial program 81.7%
associate--l+84.0%
sub-neg84.0%
+-commutative84.0%
associate-/l*90.7%
distribute-neg-frac90.7%
associate-/r/92.1%
fma-def92.1%
sub-neg92.1%
+-commutative92.1%
distribute-neg-in92.1%
unsub-neg92.1%
remove-double-neg92.1%
Simplified92.1%
Taylor expanded in a around inf 66.8%
Final simplification65.1%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 82.0%
associate--l+84.1%
sub-neg84.1%
+-commutative84.1%
associate-/l*91.4%
distribute-neg-frac91.4%
associate-/r/92.7%
fma-def92.7%
sub-neg92.7%
+-commutative92.7%
distribute-neg-in92.7%
unsub-neg92.7%
remove-double-neg92.7%
Simplified92.7%
Taylor expanded in a around inf 63.2%
Final simplification63.2%
(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 82.0%
associate--l+84.1%
sub-neg84.1%
+-commutative84.1%
associate-/l*91.4%
distribute-neg-frac91.4%
associate-/r/92.7%
fma-def92.7%
sub-neg92.7%
+-commutative92.7%
distribute-neg-in92.7%
unsub-neg92.7%
remove-double-neg92.7%
Simplified92.7%
Taylor expanded in x around inf 47.7%
Final simplification47.7%
(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 2023240
(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))))