
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (* y (- (+ (/ t (- a t)) 1.0) (/ z (- a t)))) x))
double code(double x, double y, double z, double t, double a) {
return (y * (((t / (a - t)) + 1.0) - (z / (a - t)))) + 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 * (((t / (a - t)) + 1.0d0) - (z / (a - t)))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y * (((t / (a - t)) + 1.0) - (z / (a - t)))) + x;
}
def code(x, y, z, t, a): return (y * (((t / (a - t)) + 1.0) - (z / (a - t)))) + x
function code(x, y, z, t, a) return Float64(Float64(y * Float64(Float64(Float64(t / Float64(a - t)) + 1.0) - Float64(z / Float64(a - t)))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y * (((t / (a - t)) + 1.0) - (z / (a - t)))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y * N[(N[(N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(\left(\frac{t}{a - t} + 1\right) - \frac{z}{a - t}\right) + x
\end{array}
Initial program 77.8%
associate--l+79.1%
sub-neg79.1%
+-commutative79.1%
associate-/l*88.2%
distribute-neg-frac88.2%
associate-/r/89.4%
fma-def89.4%
sub-neg89.4%
+-commutative89.4%
distribute-neg-in89.4%
unsub-neg89.4%
remove-double-neg89.4%
Simplified89.4%
Taylor expanded in y around 0 95.2%
Final simplification95.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.2e-110) (not (<= a 2.8e-13))) (+ x (+ y (/ (- t z) (/ (- a t) y)))) (- x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.2e-110) || !(a <= 2.8e-13)) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.2d-110)) .or. (.not. (a <= 2.8d-13))) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
else
tmp = x - (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.2e-110) || !(a <= 2.8e-13)) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.2e-110) or not (a <= 2.8e-13): tmp = x + (y + ((t - z) / ((a - t) / y))) else: tmp = x - (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.2e-110) || !(a <= 2.8e-13)) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); else tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.2e-110) || ~((a <= 2.8e-13))) tmp = x + (y + ((t - z) / ((a - t) / y))); else tmp = x - (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.2e-110], N[Not[LessEqual[a, 2.8e-13]], $MachinePrecision]], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{-110} \lor \neg \left(a \leq 2.8 \cdot 10^{-13}\right):\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if a < -2.1999999999999999e-110 or 2.8000000000000002e-13 < a Initial program 82.6%
associate--l+83.5%
associate-/l*95.4%
Simplified95.4%
if -2.1999999999999999e-110 < a < 2.8000000000000002e-13Initial program 71.1%
associate--l+72.8%
sub-neg72.8%
+-commutative72.8%
associate-/l*78.0%
distribute-neg-frac78.0%
associate-/r/77.2%
fma-def77.3%
sub-neg77.3%
+-commutative77.3%
distribute-neg-in77.3%
unsub-neg77.3%
remove-double-neg77.3%
Simplified77.3%
Taylor expanded in z around inf 86.8%
associate-*r/86.8%
associate-*r*86.8%
neg-mul-186.8%
Simplified86.8%
Taylor expanded in x around 0 86.8%
mul-1-neg86.8%
unsub-neg86.8%
associate-/l*89.7%
associate-/r/92.2%
Simplified92.2%
Final simplification94.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.9e-110)
(+ (+ y x) (* y (/ (- t z) (- a t))))
(if (<= a 6e-11)
(- x (* z (/ y (- a t))))
(+ x (+ y (/ (- t z) (/ (- a t) y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.9e-110) {
tmp = (y + x) + (y * ((t - z) / (a - t)));
} else if (a <= 6e-11) {
tmp = x - (z * (y / (a - t)));
} 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 (a <= (-3.9d-110)) then
tmp = (y + x) + (y * ((t - z) / (a - t)))
else if (a <= 6d-11) then
tmp = x - (z * (y / (a - t)))
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 (a <= -3.9e-110) {
tmp = (y + x) + (y * ((t - z) / (a - t)));
} else if (a <= 6e-11) {
tmp = x - (z * (y / (a - t)));
} else {
tmp = x + (y + ((t - z) / ((a - t) / y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.9e-110: tmp = (y + x) + (y * ((t - z) / (a - t))) elif a <= 6e-11: tmp = x - (z * (y / (a - t))) else: tmp = x + (y + ((t - z) / ((a - t) / y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.9e-110) tmp = Float64(Float64(y + x) + Float64(y * Float64(Float64(t - z) / Float64(a - t)))); elseif (a <= 6e-11) tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); 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 (a <= -3.9e-110) tmp = (y + x) + (y * ((t - z) / (a - t))); elseif (a <= 6e-11) tmp = x - (z * (y / (a - t))); else tmp = x + (y + ((t - z) / ((a - t) / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.9e-110], N[(N[(y + x), $MachinePrecision] + N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e-11], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $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}\;a \leq -3.9 \cdot 10^{-110}:\\
\;\;\;\;\left(y + x\right) + y \cdot \frac{t - z}{a - t}\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-11}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\end{array}
\end{array}
if a < -3.9e-110Initial program 80.1%
associate-*l/96.2%
Simplified96.2%
if -3.9e-110 < a < 6e-11Initial program 71.1%
associate--l+72.8%
sub-neg72.8%
+-commutative72.8%
associate-/l*78.0%
distribute-neg-frac78.0%
associate-/r/77.2%
fma-def77.3%
sub-neg77.3%
+-commutative77.3%
distribute-neg-in77.3%
unsub-neg77.3%
remove-double-neg77.3%
Simplified77.3%
Taylor expanded in z around inf 86.8%
associate-*r/86.8%
associate-*r*86.8%
neg-mul-186.8%
Simplified86.8%
Taylor expanded in x around 0 86.8%
mul-1-neg86.8%
unsub-neg86.8%
associate-/l*89.7%
associate-/r/92.2%
Simplified92.2%
if 6e-11 < a Initial program 86.2%
associate--l+86.2%
associate-/l*95.1%
Simplified95.1%
Final simplification94.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.55e+134)
(+ y x)
(if (<= a -5e-31)
(- x (* z (/ y a)))
(if (<= a -4.4e-66)
(+ y x)
(if (<= a 5e-73) (+ x (* z (/ y t))) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.55e+134) {
tmp = y + x;
} else if (a <= -5e-31) {
tmp = x - (z * (y / a));
} else if (a <= -4.4e-66) {
tmp = y + x;
} else if (a <= 5e-73) {
tmp = x + (z * (y / t));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.55d+134)) then
tmp = y + x
else if (a <= (-5d-31)) then
tmp = x - (z * (y / a))
else if (a <= (-4.4d-66)) then
tmp = y + x
else if (a <= 5d-73) then
tmp = x + (z * (y / t))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.55e+134) {
tmp = y + x;
} else if (a <= -5e-31) {
tmp = x - (z * (y / a));
} else if (a <= -4.4e-66) {
tmp = y + x;
} else if (a <= 5e-73) {
tmp = x + (z * (y / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.55e+134: tmp = y + x elif a <= -5e-31: tmp = x - (z * (y / a)) elif a <= -4.4e-66: tmp = y + x elif a <= 5e-73: tmp = x + (z * (y / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.55e+134) tmp = Float64(y + x); elseif (a <= -5e-31) tmp = Float64(x - Float64(z * Float64(y / a))); elseif (a <= -4.4e-66) tmp = Float64(y + x); elseif (a <= 5e-73) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.55e+134) tmp = y + x; elseif (a <= -5e-31) tmp = x - (z * (y / a)); elseif (a <= -4.4e-66) tmp = y + x; elseif (a <= 5e-73) tmp = x + (z * (y / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.55e+134], N[(y + x), $MachinePrecision], If[LessEqual[a, -5e-31], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4.4e-66], N[(y + x), $MachinePrecision], If[LessEqual[a, 5e-73], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+134}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -5 \cdot 10^{-31}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq -4.4 \cdot 10^{-66}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-73}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1.54999999999999991e134 or -5e-31 < a < -4.4000000000000002e-66 or 4.9999999999999998e-73 < a Initial program 78.7%
associate--l+78.7%
sub-neg78.7%
+-commutative78.7%
associate-/l*93.0%
distribute-neg-frac93.0%
associate-/r/95.4%
fma-def95.4%
sub-neg95.4%
+-commutative95.4%
distribute-neg-in95.4%
unsub-neg95.4%
remove-double-neg95.4%
Simplified95.4%
Taylor expanded in a around inf 79.1%
if -1.54999999999999991e134 < a < -5e-31Initial program 87.3%
associate--l+91.5%
sub-neg91.5%
+-commutative91.5%
associate-/l*97.1%
distribute-neg-frac97.1%
associate-/r/99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 90.0%
associate-*r/90.0%
associate-*r*90.0%
neg-mul-190.0%
Simplified90.0%
Taylor expanded in a around inf 86.6%
+-commutative86.6%
mul-1-neg86.6%
unsub-neg86.6%
associate-/l*86.6%
associate-/r/86.6%
Simplified86.6%
if -4.4000000000000002e-66 < a < 4.9999999999999998e-73Initial program 73.7%
associate--l+75.4%
sub-neg75.4%
+-commutative75.4%
associate-/l*79.5%
distribute-neg-frac79.5%
associate-/r/78.6%
fma-def78.7%
sub-neg78.7%
+-commutative78.7%
distribute-neg-in78.7%
unsub-neg78.7%
remove-double-neg78.7%
Simplified78.7%
Taylor expanded in y around 0 91.8%
Taylor expanded in a around 0 82.3%
associate-*l/87.8%
*-commutative87.8%
Simplified87.8%
Final simplification83.5%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.08e+135)
(+ y x)
(if (<= a -3.4e-29)
(- x (/ y (/ a z)))
(if (<= a -9.5e-67)
(+ y x)
(if (<= a 5e-73) (+ x (* z (/ y t))) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.08e+135) {
tmp = y + x;
} else if (a <= -3.4e-29) {
tmp = x - (y / (a / z));
} else if (a <= -9.5e-67) {
tmp = y + x;
} else if (a <= 5e-73) {
tmp = x + (z * (y / t));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.08d+135)) then
tmp = y + x
else if (a <= (-3.4d-29)) then
tmp = x - (y / (a / z))
else if (a <= (-9.5d-67)) then
tmp = y + x
else if (a <= 5d-73) then
tmp = x + (z * (y / t))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.08e+135) {
tmp = y + x;
} else if (a <= -3.4e-29) {
tmp = x - (y / (a / z));
} else if (a <= -9.5e-67) {
tmp = y + x;
} else if (a <= 5e-73) {
tmp = x + (z * (y / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.08e+135: tmp = y + x elif a <= -3.4e-29: tmp = x - (y / (a / z)) elif a <= -9.5e-67: tmp = y + x elif a <= 5e-73: tmp = x + (z * (y / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.08e+135) tmp = Float64(y + x); elseif (a <= -3.4e-29) tmp = Float64(x - Float64(y / Float64(a / z))); elseif (a <= -9.5e-67) tmp = Float64(y + x); elseif (a <= 5e-73) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.08e+135) tmp = y + x; elseif (a <= -3.4e-29) tmp = x - (y / (a / z)); elseif (a <= -9.5e-67) tmp = y + x; elseif (a <= 5e-73) tmp = x + (z * (y / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.08e+135], N[(y + x), $MachinePrecision], If[LessEqual[a, -3.4e-29], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -9.5e-67], N[(y + x), $MachinePrecision], If[LessEqual[a, 5e-73], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.08 \cdot 10^{+135}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq -3.4 \cdot 10^{-29}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;a \leq -9.5 \cdot 10^{-67}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-73}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1.08e135 or -3.39999999999999972e-29 < a < -9.4999999999999994e-67 or 4.9999999999999998e-73 < a Initial program 78.7%
associate--l+78.7%
sub-neg78.7%
+-commutative78.7%
associate-/l*93.0%
distribute-neg-frac93.0%
associate-/r/95.4%
fma-def95.4%
sub-neg95.4%
+-commutative95.4%
distribute-neg-in95.4%
unsub-neg95.4%
remove-double-neg95.4%
Simplified95.4%
Taylor expanded in a around inf 79.1%
if -1.08e135 < a < -3.39999999999999972e-29Initial program 87.3%
associate--l+91.5%
sub-neg91.5%
+-commutative91.5%
associate-/l*97.1%
distribute-neg-frac97.1%
associate-/r/99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 90.0%
associate-*r/90.0%
associate-*r*90.0%
neg-mul-190.0%
Simplified90.0%
Taylor expanded in x around 0 90.0%
mul-1-neg90.0%
unsub-neg90.0%
associate-/l*92.7%
associate-/r/92.6%
Simplified92.6%
Taylor expanded in a around inf 86.6%
associate-/l*86.6%
Simplified86.6%
if -9.4999999999999994e-67 < a < 4.9999999999999998e-73Initial program 73.7%
associate--l+75.4%
sub-neg75.4%
+-commutative75.4%
associate-/l*79.5%
distribute-neg-frac79.5%
associate-/r/78.6%
fma-def78.7%
sub-neg78.7%
+-commutative78.7%
distribute-neg-in78.7%
unsub-neg78.7%
remove-double-neg78.7%
Simplified78.7%
Taylor expanded in y around 0 91.8%
Taylor expanded in a around 0 82.3%
associate-*l/87.8%
*-commutative87.8%
Simplified87.8%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.9e-105) (not (<= a 9.8e-88))) (+ y (- x (/ y (/ a z)))) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.9e-105) || !(a <= 9.8e-88)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.9d-105)) .or. (.not. (a <= 9.8d-88))) then
tmp = y + (x - (y / (a / z)))
else
tmp = x + (z * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.9e-105) || !(a <= 9.8e-88)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.9e-105) or not (a <= 9.8e-88): tmp = y + (x - (y / (a / z))) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.9e-105) || !(a <= 9.8e-88)) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.9e-105) || ~((a <= 9.8e-88))) tmp = y + (x - (y / (a / z))); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.9e-105], N[Not[LessEqual[a, 9.8e-88]], $MachinePrecision]], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-105} \lor \neg \left(a \leq 9.8 \cdot 10^{-88}\right):\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if a < -1.8999999999999999e-105 or 9.80000000000000055e-88 < a Initial program 81.5%
associate--l+82.4%
sub-neg82.4%
+-commutative82.4%
associate-/l*93.7%
distribute-neg-frac93.7%
associate-/r/96.6%
fma-def96.6%
sub-neg96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
remove-double-neg96.6%
Simplified96.6%
Taylor expanded in t around 0 82.5%
mul-1-neg82.5%
sub-neg82.5%
associate-/l*90.1%
Simplified90.1%
if -1.8999999999999999e-105 < a < 9.80000000000000055e-88Initial program 71.4%
associate--l+73.3%
sub-neg73.3%
+-commutative73.3%
associate-/l*78.7%
distribute-neg-frac78.7%
associate-/r/76.8%
fma-def76.9%
sub-neg76.9%
+-commutative76.9%
distribute-neg-in76.9%
unsub-neg76.9%
remove-double-neg76.9%
Simplified76.9%
Taylor expanded in y around 0 91.1%
Taylor expanded in a around 0 84.8%
associate-*l/90.8%
*-commutative90.8%
Simplified90.8%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -8.5e-101) (not (<= a 5e-6))) (+ y (- x (/ y (/ a z)))) (- x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.5e-101) || !(a <= 5e-6)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-8.5d-101)) .or. (.not. (a <= 5d-6))) then
tmp = y + (x - (y / (a / z)))
else
tmp = x - (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.5e-101) || !(a <= 5e-6)) {
tmp = y + (x - (y / (a / z)));
} else {
tmp = x - (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -8.5e-101) or not (a <= 5e-6): tmp = y + (x - (y / (a / z))) else: tmp = x - (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -8.5e-101) || !(a <= 5e-6)) tmp = Float64(y + Float64(x - Float64(y / Float64(a / z)))); else tmp = Float64(x - Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -8.5e-101) || ~((a <= 5e-6))) tmp = y + (x - (y / (a / z))); else tmp = x - (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -8.5e-101], N[Not[LessEqual[a, 5e-6]], $MachinePrecision]], N[(y + N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-101} \lor \neg \left(a \leq 5 \cdot 10^{-6}\right):\\
\;\;\;\;y + \left(x - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if a < -8.49999999999999941e-101 or 5.00000000000000041e-6 < a Initial program 82.8%
associate--l+83.8%
sub-neg83.8%
+-commutative83.8%
associate-/l*95.3%
distribute-neg-frac95.3%
associate-/r/97.9%
fma-def97.9%
sub-neg97.9%
+-commutative97.9%
distribute-neg-in97.9%
unsub-neg97.9%
remove-double-neg97.9%
Simplified97.9%
Taylor expanded in t around 0 83.9%
mul-1-neg83.9%
sub-neg83.9%
associate-/l*92.3%
Simplified92.3%
if -8.49999999999999941e-101 < a < 5.00000000000000041e-6Initial program 71.3%
associate--l+72.9%
sub-neg72.9%
+-commutative72.9%
associate-/l*78.8%
distribute-neg-frac78.8%
associate-/r/78.0%
fma-def78.1%
sub-neg78.1%
+-commutative78.1%
distribute-neg-in78.1%
unsub-neg78.1%
remove-double-neg78.1%
Simplified78.1%
Taylor expanded in z around inf 86.4%
associate-*r/86.4%
associate-*r*86.4%
neg-mul-186.4%
Simplified86.4%
Taylor expanded in x around 0 86.4%
mul-1-neg86.4%
unsub-neg86.4%
associate-/l*89.2%
associate-/r/91.6%
Simplified91.6%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.6e+237) (/ y (/ t z)) (if (<= y 8.4e+80) (+ y x) (* y (/ (- a z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.6e+237) {
tmp = y / (t / z);
} else if (y <= 8.4e+80) {
tmp = y + x;
} else {
tmp = y * ((a - z) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-3.6d+237)) then
tmp = y / (t / z)
else if (y <= 8.4d+80) then
tmp = y + x
else
tmp = y * ((a - z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.6e+237) {
tmp = y / (t / z);
} else if (y <= 8.4e+80) {
tmp = y + x;
} else {
tmp = y * ((a - z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.6e+237: tmp = y / (t / z) elif y <= 8.4e+80: tmp = y + x else: tmp = y * ((a - z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.6e+237) tmp = Float64(y / Float64(t / z)); elseif (y <= 8.4e+80) tmp = Float64(y + x); else tmp = Float64(y * Float64(Float64(a - z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.6e+237) tmp = y / (t / z); elseif (y <= 8.4e+80) tmp = y + x; else tmp = y * ((a - z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.6e+237], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.4e+80], N[(y + x), $MachinePrecision], N[(y * N[(N[(a - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+237}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{+80}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{a - z}{a}\\
\end{array}
\end{array}
if y < -3.60000000000000015e237Initial program 41.8%
associate--l+41.8%
associate-/l*72.0%
Simplified72.0%
associate-+r-66.5%
flip-+3.2%
frac-sub2.2%
Applied egg-rr2.2%
*-commutative2.2%
*-commutative2.2%
*-commutative2.2%
Simplified2.2%
Taylor expanded in y around -inf 54.1%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in a around 0 56.8%
if -3.60000000000000015e237 < y < 8.40000000000000005e80Initial program 83.7%
associate--l+85.4%
sub-neg85.4%
+-commutative85.4%
associate-/l*91.9%
distribute-neg-frac91.9%
associate-/r/90.9%
fma-def90.9%
sub-neg90.9%
+-commutative90.9%
distribute-neg-in90.9%
unsub-neg90.9%
remove-double-neg90.9%
Simplified90.9%
Taylor expanded in a around inf 69.8%
if 8.40000000000000005e80 < y Initial program 68.1%
associate--l+68.2%
associate-/l*79.9%
Simplified79.9%
associate-+r-73.7%
flip-+25.9%
frac-sub19.0%
Applied egg-rr19.0%
*-commutative19.0%
*-commutative19.0%
*-commutative19.0%
Simplified19.0%
Taylor expanded in y around -inf 56.8%
associate-/l*84.7%
Simplified84.7%
Taylor expanded in t around 0 42.2%
*-lft-identity42.2%
times-frac68.1%
/-rgt-identity68.1%
Simplified68.1%
Final simplification68.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.5e-65) (+ y x) (if (<= a 5e-73) (+ x (* z (/ y t))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.5e-65) {
tmp = y + x;
} else if (a <= 5e-73) {
tmp = x + (z * (y / t));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.5d-65)) then
tmp = y + x
else if (a <= 5d-73) then
tmp = x + (z * (y / t))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.5e-65) {
tmp = y + x;
} else if (a <= 5e-73) {
tmp = x + (z * (y / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.5e-65: tmp = y + x elif a <= 5e-73: tmp = x + (z * (y / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.5e-65) tmp = Float64(y + x); elseif (a <= 5e-73) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.5e-65) tmp = y + x; elseif (a <= 5e-73) tmp = x + (z * (y / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.5e-65], N[(y + x), $MachinePrecision], If[LessEqual[a, 5e-73], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{-65}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-73}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -3.50000000000000005e-65 or 4.9999999999999998e-73 < a Initial program 80.6%
associate--l+81.5%
sub-neg81.5%
+-commutative81.5%
associate-/l*93.9%
distribute-neg-frac93.9%
associate-/r/96.4%
fma-def96.4%
sub-neg96.4%
+-commutative96.4%
distribute-neg-in96.4%
unsub-neg96.4%
remove-double-neg96.4%
Simplified96.4%
Taylor expanded in a around inf 76.7%
if -3.50000000000000005e-65 < a < 4.9999999999999998e-73Initial program 73.7%
associate--l+75.4%
sub-neg75.4%
+-commutative75.4%
associate-/l*79.5%
distribute-neg-frac79.5%
associate-/r/78.6%
fma-def78.7%
sub-neg78.7%
+-commutative78.7%
distribute-neg-in78.7%
unsub-neg78.7%
remove-double-neg78.7%
Simplified78.7%
Taylor expanded in y around 0 91.8%
Taylor expanded in a around 0 82.3%
associate-*l/87.8%
*-commutative87.8%
Simplified87.8%
Final simplification81.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.28e+238) (/ y (/ t z)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.28e+238) {
tmp = 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 (y <= (-1.28d+238)) then
tmp = 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 (y <= -1.28e+238) {
tmp = y / (t / z);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.28e+238: tmp = y / (t / z) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.28e+238) tmp = 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 (y <= -1.28e+238) tmp = y / (t / z); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.28e+238], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.28 \cdot 10^{+238}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if y < -1.28000000000000007e238Initial program 41.8%
associate--l+41.8%
associate-/l*72.0%
Simplified72.0%
associate-+r-66.5%
flip-+3.2%
frac-sub2.2%
Applied egg-rr2.2%
*-commutative2.2%
*-commutative2.2%
*-commutative2.2%
Simplified2.2%
Taylor expanded in y around -inf 54.1%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in a around 0 56.8%
if -1.28000000000000007e238 < y Initial program 80.6%
associate--l+81.9%
sub-neg81.9%
+-commutative81.9%
associate-/l*89.4%
distribute-neg-frac89.4%
associate-/r/90.7%
fma-def90.7%
sub-neg90.7%
+-commutative90.7%
distribute-neg-in90.7%
unsub-neg90.7%
remove-double-neg90.7%
Simplified90.7%
Taylor expanded in a around inf 65.8%
Final simplification65.2%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.1e+209) y (if (<= y 1.1e+87) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.1e+209) {
tmp = y;
} else if (y <= 1.1e+87) {
tmp = x;
} else {
tmp = 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 (y <= (-1.1d+209)) then
tmp = y
else if (y <= 1.1d+87) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.1e+209) {
tmp = y;
} else if (y <= 1.1e+87) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.1e+209: tmp = y elif y <= 1.1e+87: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.1e+209) tmp = y; elseif (y <= 1.1e+87) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.1e+209) tmp = y; elseif (y <= 1.1e+87) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.1e+209], y, If[LessEqual[y, 1.1e+87], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+209}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+87}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.0999999999999999e209 or 1.1e87 < y Initial program 61.5%
associate--l+61.6%
associate-/l*79.6%
Simplified79.6%
associate-+r-74.1%
flip-+17.0%
frac-sub12.1%
Applied egg-rr12.1%
*-commutative12.1%
*-commutative12.1%
*-commutative12.1%
Simplified12.1%
Taylor expanded in y around -inf 54.4%
associate-/l*86.9%
Simplified86.9%
Taylor expanded in a around inf 41.1%
if -1.0999999999999999e209 < y < 1.1e87Initial program 84.2%
associate--l+85.9%
sub-neg85.9%
+-commutative85.9%
associate-/l*91.6%
distribute-neg-frac91.6%
associate-/r/90.6%
fma-def90.6%
sub-neg90.6%
+-commutative90.6%
distribute-neg-in90.6%
unsub-neg90.6%
remove-double-neg90.6%
Simplified90.6%
Taylor expanded in x around inf 62.5%
Final simplification56.5%
(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 77.8%
associate--l+79.1%
sub-neg79.1%
+-commutative79.1%
associate-/l*88.2%
distribute-neg-frac88.2%
associate-/r/89.4%
fma-def89.4%
sub-neg89.4%
+-commutative89.4%
distribute-neg-in89.4%
unsub-neg89.4%
remove-double-neg89.4%
Simplified89.4%
Taylor expanded in a around inf 62.9%
Final simplification62.9%
(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 77.8%
associate--l+79.1%
sub-neg79.1%
+-commutative79.1%
associate-/l*88.2%
distribute-neg-frac88.2%
associate-/r/89.4%
fma-def89.4%
sub-neg89.4%
+-commutative89.4%
distribute-neg-in89.4%
unsub-neg89.4%
remove-double-neg89.4%
Simplified89.4%
Taylor expanded in x around inf 48.4%
Final simplification48.4%
(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 2023228
(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))))