
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 87.8%
+-commutative87.8%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.1e-15)
(+ y x)
(if (<= z 3.4e-12)
(+ x (* t (/ y a)))
(if (<= z 6.2e+84) (- x (* t (/ y z))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e-15) {
tmp = y + x;
} else if (z <= 3.4e-12) {
tmp = x + (t * (y / a));
} else if (z <= 6.2e+84) {
tmp = x - (t * (y / 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 (z <= (-3.1d-15)) then
tmp = y + x
else if (z <= 3.4d-12) then
tmp = x + (t * (y / a))
else if (z <= 6.2d+84) then
tmp = x - (t * (y / 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 (z <= -3.1e-15) {
tmp = y + x;
} else if (z <= 3.4e-12) {
tmp = x + (t * (y / a));
} else if (z <= 6.2e+84) {
tmp = x - (t * (y / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.1e-15: tmp = y + x elif z <= 3.4e-12: tmp = x + (t * (y / a)) elif z <= 6.2e+84: tmp = x - (t * (y / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e-15) tmp = Float64(y + x); elseif (z <= 3.4e-12) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 6.2e+84) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.1e-15) tmp = y + x; elseif (z <= 3.4e-12) tmp = x + (t * (y / a)); elseif (z <= 6.2e+84) tmp = x - (t * (y / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e-15], N[(y + x), $MachinePrecision], If[LessEqual[z, 3.4e-12], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+84], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-15}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-12}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+84}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -3.0999999999999999e-15 or 6.20000000000000006e84 < z Initial program 78.0%
+-commutative78.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.9%
+-commutative78.9%
Simplified78.9%
if -3.0999999999999999e-15 < z < 3.4000000000000001e-12Initial program 96.2%
+-commutative96.2%
associate-/l*97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in z around 0 75.8%
+-commutative75.8%
associate-/l*78.4%
Simplified78.4%
if 3.4000000000000001e-12 < z < 6.20000000000000006e84Initial program 86.4%
Taylor expanded in t around inf 80.6%
mul-1-neg80.6%
associate-/l*86.1%
distribute-rgt-neg-in86.1%
distribute-frac-neg286.1%
Simplified86.1%
Taylor expanded in z around inf 80.2%
mul-1-neg80.2%
unsub-neg80.2%
associate-/l*81.4%
Simplified81.4%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e+107) (not (<= t 1.3e-44))) (+ x (* y (/ t (- a z)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e+107) || !(t <= 1.3e-44)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (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 ((t <= (-9d+107)) .or. (.not. (t <= 1.3d-44))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y * (z / (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 ((t <= -9e+107) || !(t <= 1.3e-44)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e+107) or not (t <= 1.3e-44): tmp = x + (y * (t / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e+107) || !(t <= 1.3e-44)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9e+107) || ~((t <= 1.3e-44))) tmp = x + (y * (t / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e+107], N[Not[LessEqual[t, 1.3e-44]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+107} \lor \neg \left(t \leq 1.3 \cdot 10^{-44}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -9e107 or 1.2999999999999999e-44 < t Initial program 84.8%
associate-/l*98.1%
*-commutative98.1%
Applied egg-rr98.1%
Taylor expanded in z around 0 91.6%
neg-mul-191.6%
Simplified91.6%
if -9e107 < t < 1.2999999999999999e-44Initial program 89.9%
Taylor expanded in t around 0 81.0%
associate-/l*90.5%
Simplified90.5%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.5e+107) (not (<= t 1.7e-44))) (- x (* t (/ y (- z a)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.5e+107) || !(t <= 1.7e-44)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (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 ((t <= (-9.5d+107)) .or. (.not. (t <= 1.7d-44))) then
tmp = x - (t * (y / (z - a)))
else
tmp = x + (y * (z / (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 ((t <= -9.5e+107) || !(t <= 1.7e-44)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.5e+107) or not (t <= 1.7e-44): tmp = x - (t * (y / (z - a))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.5e+107) || !(t <= 1.7e-44)) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9.5e+107) || ~((t <= 1.7e-44))) tmp = x - (t * (y / (z - a))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.5e+107], N[Not[LessEqual[t, 1.7e-44]], $MachinePrecision]], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+107} \lor \neg \left(t \leq 1.7 \cdot 10^{-44}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -9.50000000000000019e107 or 1.70000000000000008e-44 < t Initial program 84.8%
Taylor expanded in t around inf 83.5%
mul-1-neg83.5%
associate-/l*90.5%
distribute-rgt-neg-in90.5%
distribute-frac-neg290.5%
Simplified90.5%
Taylor expanded in x around 0 83.5%
associate-/l*90.5%
sub-neg90.5%
+-commutative90.5%
neg-sub090.5%
associate--r-90.5%
sub0-neg90.5%
distribute-neg-frac290.5%
distribute-rgt-neg-in90.5%
sub-neg90.5%
Simplified90.5%
if -9.50000000000000019e107 < t < 1.70000000000000008e-44Initial program 89.9%
Taylor expanded in t around 0 81.0%
associate-/l*90.5%
Simplified90.5%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e+107) (not (<= t 1.3e-44))) (- x (/ (* y t) (- z a))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e+107) || !(t <= 1.3e-44)) {
tmp = x - ((y * t) / (z - a));
} else {
tmp = x + (y * (z / (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 ((t <= (-9d+107)) .or. (.not. (t <= 1.3d-44))) then
tmp = x - ((y * t) / (z - a))
else
tmp = x + (y * (z / (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 ((t <= -9e+107) || !(t <= 1.3e-44)) {
tmp = x - ((y * t) / (z - a));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e+107) or not (t <= 1.3e-44): tmp = x - ((y * t) / (z - a)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e+107) || !(t <= 1.3e-44)) tmp = Float64(x - Float64(Float64(y * t) / Float64(z - a))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9e+107) || ~((t <= 1.3e-44))) tmp = x - ((y * t) / (z - a)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e+107], N[Not[LessEqual[t, 1.3e-44]], $MachinePrecision]], N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+107} \lor \neg \left(t \leq 1.3 \cdot 10^{-44}\right):\\
\;\;\;\;x - \frac{y \cdot t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -9e107 or 1.2999999999999999e-44 < t Initial program 84.8%
Taylor expanded in t around inf 83.5%
mul-1-neg83.5%
associate-/l*90.5%
distribute-rgt-neg-in90.5%
distribute-frac-neg290.5%
Simplified90.5%
Taylor expanded in t around 0 83.5%
if -9e107 < t < 1.2999999999999999e-44Initial program 89.9%
Taylor expanded in t around 0 81.0%
associate-/l*90.5%
Simplified90.5%
Final simplification87.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.8e-153) (not (<= z 1.65e-21))) (+ x (* y (/ z (- z a)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e-153) || !(z <= 1.65e-21)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / 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 ((z <= (-3.8d-153)) .or. (.not. (z <= 1.65d-21))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (t * (y / a))
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.8e-153) || !(z <= 1.65e-21)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.8e-153) or not (z <= 1.65e-21): tmp = x + (y * (z / (z - a))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.8e-153) || !(z <= 1.65e-21)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.8e-153) || ~((z <= 1.65e-21))) tmp = x + (y * (z / (z - a))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.8e-153], N[Not[LessEqual[z, 1.65e-21]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-153} \lor \neg \left(z \leq 1.65 \cdot 10^{-21}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.80000000000000023e-153 or 1.65000000000000004e-21 < z Initial program 83.1%
Taylor expanded in t around 0 68.2%
associate-/l*81.2%
Simplified81.2%
if -3.80000000000000023e-153 < z < 1.65000000000000004e-21Initial program 95.2%
+-commutative95.2%
associate-/l*98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in z around 0 77.8%
+-commutative77.8%
associate-/l*82.0%
Simplified82.0%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e-153) (+ x (/ y (/ (- z a) z))) (if (<= z 2.7e-21) (+ x (* t (/ y a))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-153) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 2.7e-21) {
tmp = x + (t * (y / a));
} else {
tmp = x + (y * (z / (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 (z <= (-1.6d-153)) then
tmp = x + (y / ((z - a) / z))
else if (z <= 2.7d-21) then
tmp = x + (t * (y / a))
else
tmp = x + (y * (z / (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 (z <= -1.6e-153) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 2.7e-21) {
tmp = x + (t * (y / a));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e-153: tmp = x + (y / ((z - a) / z)) elif z <= 2.7e-21: tmp = x + (t * (y / a)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e-153) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= 2.7e-21) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e-153) tmp = x + (y / ((z - a) / z)); elseif (z <= 2.7e-21) tmp = x + (t * (y / a)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e-153], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-21], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-153}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-21}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -1.6e-153Initial program 85.8%
Taylor expanded in t around 0 71.6%
associate-/l*82.2%
Simplified82.2%
clear-num82.2%
un-div-inv82.2%
Applied egg-rr82.2%
if -1.6e-153 < z < 2.7000000000000001e-21Initial program 95.2%
+-commutative95.2%
associate-/l*98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in z around 0 77.8%
+-commutative77.8%
associate-/l*82.0%
Simplified82.0%
if 2.7000000000000001e-21 < z Initial program 78.9%
Taylor expanded in t around 0 63.1%
associate-/l*79.6%
Simplified79.6%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.3e-15) (not (<= z 3.4e+80))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.3e-15) || !(z <= 3.4e+80)) {
tmp = y + x;
} else {
tmp = x + (t * (y / 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 ((z <= (-1.3d-15)) .or. (.not. (z <= 3.4d+80))) then
tmp = y + x
else
tmp = x + (t * (y / a))
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.3e-15) || !(z <= 3.4e+80)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.3e-15) or not (z <= 3.4e+80): tmp = y + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.3e-15) || !(z <= 3.4e+80)) tmp = Float64(y + x); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.3e-15) || ~((z <= 3.4e+80))) tmp = y + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.3e-15], N[Not[LessEqual[z, 3.4e+80]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-15} \lor \neg \left(z \leq 3.4 \cdot 10^{+80}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.30000000000000002e-15 or 3.39999999999999992e80 < z Initial program 78.2%
+-commutative78.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -1.30000000000000002e-15 < z < 3.39999999999999992e80Initial program 94.8%
+-commutative94.8%
associate-/l*98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in z around 0 72.6%
+-commutative72.6%
associate-/l*75.4%
Simplified75.4%
Final simplification76.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e-17) (not (<= z 1.42e+81))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e-17) || !(z <= 1.42e+81)) {
tmp = y + x;
} else {
tmp = x + (y * (t / 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 ((z <= (-5.5d-17)) .or. (.not. (z <= 1.42d+81))) then
tmp = y + x
else
tmp = x + (y * (t / a))
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.5e-17) || !(z <= 1.42e+81)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.5e-17) or not (z <= 1.42e+81): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e-17) || !(z <= 1.42e+81)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.5e-17) || ~((z <= 1.42e+81))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e-17], N[Not[LessEqual[z, 1.42e+81]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-17} \lor \neg \left(z \leq 1.42 \cdot 10^{+81}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -5.50000000000000001e-17 or 1.41999999999999998e81 < z Initial program 78.2%
+-commutative78.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -5.50000000000000001e-17 < z < 1.41999999999999998e81Initial program 94.8%
associate-/l*98.0%
*-commutative98.0%
Applied egg-rr98.0%
Taylor expanded in z around 0 75.0%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.22e+72) (not (<= y 1.6e+221))) (* t (/ y (- a z))) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.22e+72) || !(y <= 1.6e+221)) {
tmp = t * (y / (a - 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.22d+72)) .or. (.not. (y <= 1.6d+221))) then
tmp = t * (y / (a - 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.22e+72) || !(y <= 1.6e+221)) {
tmp = t * (y / (a - z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.22e+72) or not (y <= 1.6e+221): tmp = t * (y / (a - z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.22e+72) || !(y <= 1.6e+221)) tmp = Float64(t * Float64(y / Float64(a - 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.22e+72) || ~((y <= 1.6e+221))) tmp = t * (y / (a - z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.22e+72], N[Not[LessEqual[y, 1.6e+221]], $MachinePrecision]], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+72} \lor \neg \left(y \leq 1.6 \cdot 10^{+221}\right):\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if y < -1.2200000000000001e72 or 1.6e221 < y Initial program 63.0%
Taylor expanded in t around inf 51.7%
mul-1-neg51.7%
associate-/l*67.2%
distribute-rgt-neg-in67.2%
distribute-frac-neg267.2%
Simplified67.2%
Taylor expanded in t around inf 62.1%
+-commutative62.1%
Simplified62.1%
Taylor expanded in y around inf 51.5%
if -1.2200000000000001e72 < y < 1.6e221Initial program 95.6%
+-commutative95.6%
associate-/l*98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in z around inf 70.3%
+-commutative70.3%
Simplified70.3%
Final simplification65.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.46e+72) (* t (/ y (- a z))) (if (<= y 7.2e+211) (+ y x) (* y (/ (- z t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.46e+72) {
tmp = t * (y / (a - z));
} else if (y <= 7.2e+211) {
tmp = y + x;
} else {
tmp = y * ((z - 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 (y <= (-1.46d+72)) then
tmp = t * (y / (a - z))
else if (y <= 7.2d+211) then
tmp = y + x
else
tmp = y * ((z - 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 (y <= -1.46e+72) {
tmp = t * (y / (a - z));
} else if (y <= 7.2e+211) {
tmp = y + x;
} else {
tmp = y * ((z - t) / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.46e+72: tmp = t * (y / (a - z)) elif y <= 7.2e+211: tmp = y + x else: tmp = y * ((z - t) / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.46e+72) tmp = Float64(t * Float64(y / Float64(a - z))); elseif (y <= 7.2e+211) tmp = Float64(y + x); else tmp = Float64(y * Float64(Float64(z - t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.46e+72) tmp = t * (y / (a - z)); elseif (y <= 7.2e+211) tmp = y + x; else tmp = y * ((z - t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.46e+72], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+211], N[(y + x), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.46 \cdot 10^{+72}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+211}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if y < -1.45999999999999999e72Initial program 62.9%
Taylor expanded in t around inf 50.3%
mul-1-neg50.3%
associate-/l*68.8%
distribute-rgt-neg-in68.8%
distribute-frac-neg268.8%
Simplified68.8%
Taylor expanded in t around inf 63.9%
+-commutative63.9%
Simplified63.9%
Taylor expanded in y around inf 50.4%
if -1.45999999999999999e72 < y < 7.20000000000000006e211Initial program 96.4%
+-commutative96.4%
associate-/l*98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in z around inf 70.7%
+-commutative70.7%
Simplified70.7%
if 7.20000000000000006e211 < y Initial program 61.2%
+-commutative61.2%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around -inf 52.7%
Taylor expanded in a around 0 49.7%
associate-/l*64.2%
Simplified64.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -8e+45) x (if (<= a 1.8e+100) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8e+45) {
tmp = x;
} else if (a <= 1.8e+100) {
tmp = y + x;
} 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) :: tmp
if (a <= (-8d+45)) then
tmp = x
else if (a <= 1.8d+100) then
tmp = y + x
else
tmp = 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 <= -8e+45) {
tmp = x;
} else if (a <= 1.8e+100) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8e+45: tmp = x elif a <= 1.8e+100: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8e+45) tmp = x; elseif (a <= 1.8e+100) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8e+45) tmp = x; elseif (a <= 1.8e+100) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8e+45], x, If[LessEqual[a, 1.8e+100], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+100}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -7.9999999999999994e45 or 1.8e100 < a Initial program 80.8%
+-commutative80.8%
associate-/l*98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in y around 0 64.3%
if -7.9999999999999994e45 < a < 1.8e100Initial program 91.9%
+-commutative91.9%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in z around inf 65.7%
+-commutative65.7%
Simplified65.7%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.7e-266) x (if (<= x 3.7e-141) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.7e-266) {
tmp = x;
} else if (x <= 3.7e-141) {
tmp = y;
} 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) :: tmp
if (x <= (-1.7d-266)) then
tmp = x
else if (x <= 3.7d-141) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.7e-266) {
tmp = x;
} else if (x <= 3.7e-141) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.7e-266: tmp = x elif x <= 3.7e-141: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.7e-266) tmp = x; elseif (x <= 3.7e-141) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.7e-266) tmp = x; elseif (x <= 3.7e-141) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.7e-266], x, If[LessEqual[x, 3.7e-141], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-266}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-141}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.69999999999999997e-266 or 3.7e-141 < x Initial program 87.3%
+-commutative87.3%
associate-/l*99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in y around 0 63.5%
if -1.69999999999999997e-266 < x < 3.7e-141Initial program 90.6%
+-commutative90.6%
associate-/l*97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in y around -inf 84.1%
Taylor expanded in z around inf 36.0%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 87.8%
associate-/l*98.8%
*-commutative98.8%
Applied egg-rr98.8%
Final simplification98.8%
(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 87.8%
+-commutative87.8%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in y around 0 54.6%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - 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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024170
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))