
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.5e+145) (not (<= t 1.9e+91))) (+ x (/ y (/ t (- z a)))) (+ x (fma (/ (- t z) (- a t)) y y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.5e+145) || !(t <= 1.9e+91)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = x + fma(((t - z) / (a - t)), y, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.5e+145) || !(t <= 1.9e+91)) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); else tmp = Float64(x + fma(Float64(Float64(t - z) / Float64(a - t)), y, y)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.5e+145], N[Not[LessEqual[t, 1.9e+91]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+145} \lor \neg \left(t \leq 1.9 \cdot 10^{+91}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(\frac{t - z}{a - t}, y, y\right)\\
\end{array}
\end{array}
if t < -2.49999999999999983e145 or 1.8999999999999999e91 < t Initial program 42.9%
sub-neg42.9%
associate-+l+53.1%
distribute-frac-neg53.1%
distribute-rgt-neg-out53.1%
+-commutative53.1%
distribute-rgt-neg-out53.1%
distribute-lft-neg-in53.1%
associate-*l/73.3%
fma-def73.3%
neg-sub073.3%
associate-+l-73.3%
neg-sub073.3%
+-commutative73.3%
sub-neg73.3%
Simplified73.3%
Taylor expanded in t around inf 53.5%
mul-1-neg53.5%
associate-+r+73.3%
mul-1-neg73.3%
distribute-rgt1-in73.3%
metadata-eval73.3%
div073.3%
associate-/r/73.3%
div073.3%
associate-/l*93.9%
Simplified93.9%
if -2.49999999999999983e145 < t < 1.8999999999999999e91Initial program 87.6%
sub-neg87.6%
associate-+l+90.7%
distribute-frac-neg90.7%
distribute-rgt-neg-out90.7%
+-commutative90.7%
distribute-rgt-neg-out90.7%
distribute-lft-neg-in90.7%
associate-*l/93.6%
fma-def93.6%
neg-sub093.6%
associate-+l-93.6%
neg-sub093.6%
+-commutative93.6%
sub-neg93.6%
Simplified93.6%
Final simplification93.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.25e+99) (not (<= t 2.3e+89))) (+ x (/ y (/ t (- z a)))) (+ x (+ y (/ (* y (- t z)) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.25e+99) || !(t <= 2.3e+89)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = x + (y + ((y * (t - z)) / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.25d+99)) .or. (.not. (t <= 2.3d+89))) then
tmp = x + (y / (t / (z - a)))
else
tmp = x + (y + ((y * (t - z)) / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.25e+99) || !(t <= 2.3e+89)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = x + (y + ((y * (t - z)) / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.25e+99) or not (t <= 2.3e+89): tmp = x + (y / (t / (z - a))) else: tmp = x + (y + ((y * (t - z)) / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.25e+99) || !(t <= 2.3e+89)) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); else tmp = Float64(x + Float64(y + Float64(Float64(y * Float64(t - z)) / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.25e+99) || ~((t <= 2.3e+89))) tmp = x + (y / (t / (z - a))); else tmp = x + (y + ((y * (t - z)) / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.25e+99], N[Not[LessEqual[t, 2.3e+89]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.25 \cdot 10^{+99} \lor \neg \left(t \leq 2.3 \cdot 10^{+89}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \frac{y \cdot \left(t - z\right)}{a - t}\right)\\
\end{array}
\end{array}
if t < -4.24999999999999992e99 or 2.2999999999999999e89 < t Initial program 43.0%
sub-neg43.0%
associate-+l+54.6%
distribute-frac-neg54.6%
distribute-rgt-neg-out54.6%
+-commutative54.6%
distribute-rgt-neg-out54.6%
distribute-lft-neg-in54.6%
associate-*l/74.3%
fma-def74.3%
neg-sub074.3%
associate-+l-74.3%
neg-sub074.3%
+-commutative74.3%
sub-neg74.3%
Simplified74.3%
Taylor expanded in t around inf 55.0%
mul-1-neg55.0%
associate-+r+74.3%
mul-1-neg74.3%
distribute-rgt1-in74.3%
metadata-eval74.3%
div074.3%
associate-/r/74.3%
div074.3%
associate-/l*93.3%
Simplified93.3%
if -4.24999999999999992e99 < t < 2.2999999999999999e89Initial program 89.4%
associate--l+91.5%
sub-neg91.5%
distribute-frac-neg91.5%
distribute-rgt-neg-out91.5%
distribute-rgt-neg-out91.5%
distribute-lft-neg-in91.5%
*-commutative91.5%
neg-sub091.5%
associate-+l-91.5%
neg-sub091.5%
+-commutative91.5%
sub-neg91.5%
Simplified91.5%
Final simplification92.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.8e+99) (not (<= t 3.1e+90))) (+ x (/ y (/ t (- z a)))) (+ (+ x y) (* y (/ (- t z) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.8e+99) || !(t <= 3.1e+90)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) + (y * ((t - z) / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.8d+99)) .or. (.not. (t <= 3.1d+90))) then
tmp = x + (y / (t / (z - a)))
else
tmp = (x + y) + (y * ((t - z) / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.8e+99) || !(t <= 3.1e+90)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) + (y * ((t - z) / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.8e+99) or not (t <= 3.1e+90): tmp = x + (y / (t / (z - a))) else: tmp = (x + y) + (y * ((t - z) / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.8e+99) || !(t <= 3.1e+90)) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); else tmp = Float64(Float64(x + y) + Float64(y * Float64(Float64(t - z) / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.8e+99) || ~((t <= 3.1e+90))) tmp = x + (y / (t / (z - a))); else tmp = (x + y) + (y * ((t - z) / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.8e+99], N[Not[LessEqual[t, 3.1e+90]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+99} \lor \neg \left(t \leq 3.1 \cdot 10^{+90}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + y \cdot \frac{t - z}{a - t}\\
\end{array}
\end{array}
if t < -3.8e99 or 3.09999999999999988e90 < t Initial program 43.0%
sub-neg43.0%
associate-+l+54.6%
distribute-frac-neg54.6%
distribute-rgt-neg-out54.6%
+-commutative54.6%
distribute-rgt-neg-out54.6%
distribute-lft-neg-in54.6%
associate-*l/74.3%
fma-def74.3%
neg-sub074.3%
associate-+l-74.3%
neg-sub074.3%
+-commutative74.3%
sub-neg74.3%
Simplified74.3%
Taylor expanded in t around inf 55.0%
mul-1-neg55.0%
associate-+r+74.3%
mul-1-neg74.3%
distribute-rgt1-in74.3%
metadata-eval74.3%
div074.3%
associate-/r/74.3%
div074.3%
associate-/l*93.3%
Simplified93.3%
if -3.8e99 < t < 3.09999999999999988e90Initial program 89.4%
associate-*l/91.8%
Simplified91.8%
Final simplification92.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.25e-32)
(+ x y)
(if (<= a -6.2e-55)
(* (/ z (- a t)) (- y))
(if (<= a -2.4e-80)
(+ x y)
(if (<= a 9e-19) (+ x (/ (* y z) t)) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.25e-32) {
tmp = x + y;
} else if (a <= -6.2e-55) {
tmp = (z / (a - t)) * -y;
} else if (a <= -2.4e-80) {
tmp = x + y;
} else if (a <= 9e-19) {
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 <= (-2.25d-32)) then
tmp = x + y
else if (a <= (-6.2d-55)) then
tmp = (z / (a - t)) * -y
else if (a <= (-2.4d-80)) then
tmp = x + y
else if (a <= 9d-19) 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 <= -2.25e-32) {
tmp = x + y;
} else if (a <= -6.2e-55) {
tmp = (z / (a - t)) * -y;
} else if (a <= -2.4e-80) {
tmp = x + y;
} else if (a <= 9e-19) {
tmp = x + ((y * z) / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.25e-32: tmp = x + y elif a <= -6.2e-55: tmp = (z / (a - t)) * -y elif a <= -2.4e-80: tmp = x + y elif a <= 9e-19: tmp = x + ((y * z) / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.25e-32) tmp = Float64(x + y); elseif (a <= -6.2e-55) tmp = Float64(Float64(z / Float64(a - t)) * Float64(-y)); elseif (a <= -2.4e-80) tmp = Float64(x + y); elseif (a <= 9e-19) 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 <= -2.25e-32) tmp = x + y; elseif (a <= -6.2e-55) tmp = (z / (a - t)) * -y; elseif (a <= -2.4e-80) tmp = x + y; elseif (a <= 9e-19) tmp = x + ((y * z) / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.25e-32], N[(x + y), $MachinePrecision], If[LessEqual[a, -6.2e-55], N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[a, -2.4e-80], N[(x + y), $MachinePrecision], If[LessEqual[a, 9e-19], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.25 \cdot 10^{-32}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -6.2 \cdot 10^{-55}:\\
\;\;\;\;\frac{z}{a - t} \cdot \left(-y\right)\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-80}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-19}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -2.25000000000000002e-32 or -6.19999999999999993e-55 < a < -2.3999999999999999e-80 or 9.00000000000000026e-19 < a Initial program 79.5%
associate--l+80.4%
sub-neg80.4%
distribute-frac-neg80.4%
distribute-rgt-neg-out80.4%
distribute-rgt-neg-out80.4%
distribute-lft-neg-in80.4%
*-commutative80.4%
neg-sub080.4%
associate-+l-80.4%
neg-sub080.4%
+-commutative80.4%
sub-neg80.4%
Simplified80.4%
Taylor expanded in a around inf 74.8%
+-commutative74.8%
Simplified74.8%
if -2.25000000000000002e-32 < a < -6.19999999999999993e-55Initial program 67.4%
associate-*l/67.7%
Simplified67.7%
Taylor expanded in y around -inf 67.7%
mul-1-neg67.7%
distribute-neg-frac67.7%
Simplified67.7%
Taylor expanded in z around inf 83.8%
associate-*r/83.8%
mul-1-neg83.8%
Simplified83.8%
if -2.3999999999999999e-80 < a < 9.00000000000000026e-19Initial program 64.2%
sub-neg64.2%
associate-+l+76.5%
distribute-frac-neg76.5%
distribute-rgt-neg-out76.5%
+-commutative76.5%
distribute-rgt-neg-out76.5%
distribute-lft-neg-in76.5%
associate-*l/81.3%
fma-def81.3%
neg-sub081.3%
associate-+l-81.3%
neg-sub081.3%
+-commutative81.3%
sub-neg81.3%
Simplified81.3%
add-cube-cbrt_binary6481.2%
Applied rewrite-once81.2%
Taylor expanded in z around inf 86.5%
associate-*r/86.5%
associate-*r*86.5%
mul-1-neg86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in a around 0 77.0%
Final simplification75.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4.4e-30)
(- (+ x y) (* z (/ y a)))
(if (<= a -3e-266)
(- x (/ (* y z) (- a t)))
(if (<= a 3.4e+38) (+ x (/ y (/ t (- z a)))) (- (+ x y) (* y (/ z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.4e-30) {
tmp = (x + y) - (z * (y / a));
} else if (a <= -3e-266) {
tmp = x - ((y * z) / (a - t));
} else if (a <= 3.4e+38) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-4.4d-30)) then
tmp = (x + y) - (z * (y / a))
else if (a <= (-3d-266)) then
tmp = x - ((y * z) / (a - t))
else if (a <= 3.4d+38) then
tmp = x + (y / (t / (z - a)))
else
tmp = (x + y) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.4e-30) {
tmp = (x + y) - (z * (y / a));
} else if (a <= -3e-266) {
tmp = x - ((y * z) / (a - t));
} else if (a <= 3.4e+38) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.4e-30: tmp = (x + y) - (z * (y / a)) elif a <= -3e-266: tmp = x - ((y * z) / (a - t)) elif a <= 3.4e+38: tmp = x + (y / (t / (z - a))) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.4e-30) tmp = Float64(Float64(x + y) - Float64(z * Float64(y / a))); elseif (a <= -3e-266) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); elseif (a <= 3.4e+38) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.4e-30) tmp = (x + y) - (z * (y / a)); elseif (a <= -3e-266) tmp = x - ((y * z) / (a - t)); elseif (a <= 3.4e+38) tmp = x + (y / (t / (z - a))); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.4e-30], N[(N[(x + y), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -3e-266], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.4e+38], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.4 \cdot 10^{-30}:\\
\;\;\;\;\left(x + y\right) - z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq -3 \cdot 10^{-266}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+38}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -4.39999999999999967e-30Initial program 75.8%
associate-*l/91.1%
Simplified91.1%
Taylor expanded in t around 0 79.3%
associate-/l*86.5%
associate-/r/86.5%
Applied egg-rr86.5%
if -4.39999999999999967e-30 < a < -3e-266Initial program 80.1%
associate--l+85.0%
sub-neg85.0%
distribute-frac-neg85.0%
distribute-rgt-neg-out85.0%
distribute-rgt-neg-out85.0%
distribute-lft-neg-in85.0%
*-commutative85.0%
neg-sub085.0%
associate-+l-85.0%
neg-sub085.0%
+-commutative85.0%
sub-neg85.0%
Simplified85.0%
Taylor expanded in z around inf 88.2%
associate-*r/88.2%
mul-1-neg88.2%
distribute-rgt-neg-out88.2%
Simplified88.2%
if -3e-266 < a < 3.39999999999999996e38Initial program 58.7%
sub-neg58.7%
associate-+l+72.0%
distribute-frac-neg72.0%
distribute-rgt-neg-out72.0%
+-commutative72.0%
distribute-rgt-neg-out72.0%
distribute-lft-neg-in72.0%
associate-*l/78.8%
fma-def78.8%
neg-sub078.8%
associate-+l-78.8%
neg-sub078.8%
+-commutative78.8%
sub-neg78.8%
Simplified78.8%
Taylor expanded in t around inf 66.2%
mul-1-neg66.2%
associate-+r+84.5%
mul-1-neg84.5%
distribute-rgt1-in84.5%
metadata-eval84.5%
div084.5%
associate-/r/80.0%
div084.5%
associate-/l*89.8%
Simplified89.8%
if 3.39999999999999996e38 < a Initial program 81.2%
associate-*l/88.0%
Simplified88.0%
Taylor expanded in t around 0 88.2%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.2e+100) (not (<= t 3.9e+90))) (+ x (/ y (/ t (- z a)))) (- (+ x y) (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.2e+100) || !(t <= 3.9e+90)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) - (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.2d+100)) .or. (.not. (t <= 3.9d+90))) then
tmp = x + (y / (t / (z - a)))
else
tmp = (x + y) - (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.2e+100) || !(t <= 3.9e+90)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) - (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.2e+100) or not (t <= 3.9e+90): tmp = x + (y / (t / (z - a))) else: tmp = (x + y) - (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.2e+100) || !(t <= 3.9e+90)) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.2e+100) || ~((t <= 3.9e+90))) tmp = x + (y / (t / (z - a))); else tmp = (x + y) - (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.2e+100], N[Not[LessEqual[t, 3.9e+90]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+100} \lor \neg \left(t \leq 3.9 \cdot 10^{+90}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1.20000000000000006e100 or 3.9000000000000002e90 < t Initial program 43.0%
sub-neg43.0%
associate-+l+54.6%
distribute-frac-neg54.6%
distribute-rgt-neg-out54.6%
+-commutative54.6%
distribute-rgt-neg-out54.6%
distribute-lft-neg-in54.6%
associate-*l/74.3%
fma-def74.3%
neg-sub074.3%
associate-+l-74.3%
neg-sub074.3%
+-commutative74.3%
sub-neg74.3%
Simplified74.3%
Taylor expanded in t around inf 55.0%
mul-1-neg55.0%
associate-+r+74.3%
mul-1-neg74.3%
distribute-rgt1-in74.3%
metadata-eval74.3%
div074.3%
associate-/r/74.3%
div074.3%
associate-/l*93.3%
Simplified93.3%
if -1.20000000000000006e100 < t < 3.9000000000000002e90Initial program 89.4%
associate-*l/91.8%
Simplified91.8%
Taylor expanded in z around inf 91.1%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.2e-144) (not (<= a 9e-22))) (- (+ x y) (* z (/ y a))) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.2e-144) || !(a <= 9e-22)) {
tmp = (x + y) - (z * (y / a));
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-6.2d-144)) .or. (.not. (a <= 9d-22))) then
tmp = (x + y) - (z * (y / a))
else
tmp = x + ((y * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.2e-144) || !(a <= 9e-22)) {
tmp = (x + y) - (z * (y / a));
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.2e-144) or not (a <= 9e-22): tmp = (x + y) - (z * (y / a)) else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.2e-144) || !(a <= 9e-22)) tmp = Float64(Float64(x + y) - Float64(z * Float64(y / a))); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6.2e-144) || ~((a <= 9e-22))) tmp = (x + y) - (z * (y / a)); else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.2e-144], N[Not[LessEqual[a, 9e-22]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{-144} \lor \neg \left(a \leq 9 \cdot 10^{-22}\right):\\
\;\;\;\;\left(x + y\right) - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -6.2000000000000001e-144 or 8.99999999999999973e-22 < a Initial program 79.7%
associate-*l/88.8%
Simplified88.8%
Taylor expanded in t around 0 78.3%
associate-/l*82.5%
associate-/r/81.3%
Applied egg-rr81.3%
if -6.2000000000000001e-144 < a < 8.99999999999999973e-22Initial program 60.7%
sub-neg60.7%
associate-+l+73.8%
distribute-frac-neg73.8%
distribute-rgt-neg-out73.8%
+-commutative73.8%
distribute-rgt-neg-out73.8%
distribute-lft-neg-in73.8%
associate-*l/79.4%
fma-def79.4%
neg-sub079.4%
associate-+l-79.4%
neg-sub079.4%
+-commutative79.4%
sub-neg79.4%
Simplified79.4%
add-cube-cbrt_binary6479.2%
Applied rewrite-once79.2%
Taylor expanded in z around inf 86.4%
associate-*r/86.4%
associate-*r*86.4%
mul-1-neg86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in a around 0 81.0%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.7e-144) (not (<= a 1.32e-21))) (- (+ x y) (* y (/ z a))) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.7e-144) || !(a <= 1.32e-21)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-4.7d-144)) .or. (.not. (a <= 1.32d-21))) then
tmp = (x + y) - (y * (z / a))
else
tmp = x + ((y * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.7e-144) || !(a <= 1.32e-21)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.7e-144) or not (a <= 1.32e-21): tmp = (x + y) - (y * (z / a)) else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.7e-144) || !(a <= 1.32e-21)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.7e-144) || ~((a <= 1.32e-21))) tmp = (x + y) - (y * (z / a)); else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.7e-144], N[Not[LessEqual[a, 1.32e-21]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.7 \cdot 10^{-144} \lor \neg \left(a \leq 1.32 \cdot 10^{-21}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -4.7000000000000002e-144 or 1.32e-21 < a Initial program 79.7%
associate-*l/88.8%
Simplified88.8%
Taylor expanded in t around 0 82.5%
if -4.7000000000000002e-144 < a < 1.32e-21Initial program 60.7%
sub-neg60.7%
associate-+l+73.8%
distribute-frac-neg73.8%
distribute-rgt-neg-out73.8%
+-commutative73.8%
distribute-rgt-neg-out73.8%
distribute-lft-neg-in73.8%
associate-*l/79.4%
fma-def79.4%
neg-sub079.4%
associate-+l-79.4%
neg-sub079.4%
+-commutative79.4%
sub-neg79.4%
Simplified79.4%
add-cube-cbrt_binary6479.2%
Applied rewrite-once79.2%
Taylor expanded in z around inf 86.4%
associate-*r/86.4%
associate-*r*86.4%
mul-1-neg86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in a around 0 81.0%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.56e-30) (- (+ x y) (* z (/ y a))) (if (<= a 6e+39) (- x (/ (* y z) (- a t))) (- (+ x y) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.56e-30) {
tmp = (x + y) - (z * (y / a));
} else if (a <= 6e+39) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.56d-30)) then
tmp = (x + y) - (z * (y / a))
else if (a <= 6d+39) then
tmp = x - ((y * z) / (a - t))
else
tmp = (x + y) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.56e-30) {
tmp = (x + y) - (z * (y / a));
} else if (a <= 6e+39) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.56e-30: tmp = (x + y) - (z * (y / a)) elif a <= 6e+39: tmp = x - ((y * z) / (a - t)) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.56e-30) tmp = Float64(Float64(x + y) - Float64(z * Float64(y / a))); elseif (a <= 6e+39) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.56e-30) tmp = (x + y) - (z * (y / a)); elseif (a <= 6e+39) tmp = x - ((y * z) / (a - t)); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.56e-30], N[(N[(x + y), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e+39], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.56 \cdot 10^{-30}:\\
\;\;\;\;\left(x + y\right) - z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 6 \cdot 10^{+39}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -1.5600000000000001e-30Initial program 75.8%
associate-*l/91.1%
Simplified91.1%
Taylor expanded in t around 0 79.3%
associate-/l*86.5%
associate-/r/86.5%
Applied egg-rr86.5%
if -1.5600000000000001e-30 < a < 5.9999999999999999e39Initial program 68.2%
associate--l+77.8%
sub-neg77.8%
distribute-frac-neg77.8%
distribute-rgt-neg-out77.8%
distribute-rgt-neg-out77.8%
distribute-lft-neg-in77.8%
*-commutative77.8%
neg-sub077.8%
associate-+l-77.8%
neg-sub077.8%
+-commutative77.8%
sub-neg77.8%
Simplified77.8%
Taylor expanded in z around inf 84.9%
associate-*r/84.9%
mul-1-neg84.9%
distribute-rgt-neg-out84.9%
Simplified84.9%
if 5.9999999999999999e39 < a Initial program 81.2%
associate-*l/88.0%
Simplified88.0%
Taylor expanded in t around 0 88.2%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -8e-31) (+ x y) (if (<= a 1.7e-18) (+ x (/ (* y z) t)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8e-31) {
tmp = x + y;
} else if (a <= 1.7e-18) {
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 <= (-8d-31)) then
tmp = x + y
else if (a <= 1.7d-18) 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 <= -8e-31) {
tmp = x + y;
} else if (a <= 1.7e-18) {
tmp = x + ((y * z) / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8e-31: tmp = x + y elif a <= 1.7e-18: tmp = x + ((y * z) / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8e-31) tmp = Float64(x + y); elseif (a <= 1.7e-18) 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 <= -8e-31) tmp = x + y; elseif (a <= 1.7e-18) tmp = x + ((y * z) / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8e-31], N[(x + y), $MachinePrecision], If[LessEqual[a, 1.7e-18], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{-31}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-18}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -8.000000000000001e-31 or 1.70000000000000001e-18 < a Initial program 78.0%
associate--l+79.0%
sub-neg79.0%
distribute-frac-neg79.0%
distribute-rgt-neg-out79.0%
distribute-rgt-neg-out79.0%
distribute-lft-neg-in79.0%
*-commutative79.0%
neg-sub079.0%
associate-+l-79.0%
neg-sub079.0%
+-commutative79.0%
sub-neg79.0%
Simplified79.0%
Taylor expanded in a around inf 75.0%
+-commutative75.0%
Simplified75.0%
if -8.000000000000001e-31 < a < 1.70000000000000001e-18Initial program 67.4%
sub-neg67.4%
associate-+l+78.0%
distribute-frac-neg78.0%
distribute-rgt-neg-out78.0%
+-commutative78.0%
distribute-rgt-neg-out78.0%
distribute-lft-neg-in78.0%
associate-*l/82.2%
fma-def82.2%
neg-sub082.2%
associate-+l-82.2%
neg-sub082.2%
+-commutative82.2%
sub-neg82.2%
Simplified82.2%
add-cube-cbrt_binary6482.0%
Applied rewrite-once82.0%
Taylor expanded in z around inf 85.9%
associate-*r/85.9%
associate-*r*85.9%
mul-1-neg85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in a around 0 73.3%
Final simplification74.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.9e-144) (+ x y) (if (<= a 2.4e+38) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.9e-144) {
tmp = x + y;
} else if (a <= 2.4e+38) {
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 <= (-4.9d-144)) then
tmp = x + y
else if (a <= 2.4d+38) 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 <= -4.9e-144) {
tmp = x + y;
} else if (a <= 2.4e+38) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.9e-144: tmp = x + y elif a <= 2.4e+38: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.9e-144) tmp = Float64(x + y); elseif (a <= 2.4e+38) 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 <= -4.9e-144) tmp = x + y; elseif (a <= 2.4e+38) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.9e-144], N[(x + y), $MachinePrecision], If[LessEqual[a, 2.4e+38], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.9 \cdot 10^{-144}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.9000000000000001e-144 or 2.40000000000000017e38 < a Initial program 80.3%
associate--l+81.2%
sub-neg81.2%
distribute-frac-neg81.2%
distribute-rgt-neg-out81.2%
distribute-rgt-neg-out81.2%
distribute-lft-neg-in81.2%
*-commutative81.2%
neg-sub081.2%
associate-+l-81.2%
neg-sub081.2%
+-commutative81.2%
sub-neg81.2%
Simplified81.2%
Taylor expanded in a around inf 70.1%
+-commutative70.1%
Simplified70.1%
if -4.9000000000000001e-144 < a < 2.40000000000000017e38Initial program 62.3%
associate--l+74.5%
sub-neg74.5%
distribute-frac-neg74.5%
distribute-rgt-neg-out74.5%
distribute-rgt-neg-out74.5%
distribute-lft-neg-in74.5%
*-commutative74.5%
neg-sub074.5%
associate-+l-74.5%
neg-sub074.5%
+-commutative74.5%
sub-neg74.5%
Simplified74.5%
Taylor expanded in x around inf 54.6%
Final simplification63.9%
(FPCore (x y z t a) :precision binary64 (if (<= y 3.1e+116) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3.1e+116) {
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 <= 3.1d+116) 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 <= 3.1e+116) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 3.1e+116: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 3.1e+116) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 3.1e+116) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 3.1e+116], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{+116}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 3.09999999999999996e116Initial program 78.3%
associate--l+84.2%
sub-neg84.2%
distribute-frac-neg84.2%
distribute-rgt-neg-out84.2%
distribute-rgt-neg-out84.2%
distribute-lft-neg-in84.2%
*-commutative84.2%
neg-sub084.2%
associate-+l-84.2%
neg-sub084.2%
+-commutative84.2%
sub-neg84.2%
Simplified84.2%
Taylor expanded in x around inf 60.9%
if 3.09999999999999996e116 < y Initial program 48.4%
associate-*l/67.6%
Simplified67.6%
Taylor expanded in x around 0 48.2%
Taylor expanded in z around inf 49.7%
associate-/l*62.4%
Simplified62.4%
Taylor expanded in a around inf 32.9%
Final simplification55.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 73.1%
associate--l+78.5%
sub-neg78.5%
distribute-frac-neg78.5%
distribute-rgt-neg-out78.5%
distribute-rgt-neg-out78.5%
distribute-lft-neg-in78.5%
*-commutative78.5%
neg-sub078.5%
associate-+l-78.5%
neg-sub078.5%
+-commutative78.5%
sub-neg78.5%
Simplified78.5%
Taylor expanded in x around inf 52.2%
Final simplification52.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023297
(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))))