
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (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)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{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)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (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)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- z t) (- a t)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (a - t)) * y);
}
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 + (((z - t) / (a - t)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (a - t)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (a - t)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(a - t)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (a - t)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{a - t} \cdot y
\end{array}
Initial program 84.3%
associate-/l*98.2%
Simplified98.2%
div-inv98.1%
*-commutative98.1%
clear-num98.2%
Applied egg-rr98.2%
Final simplification98.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.02e+37) (not (<= t 5.8e+95))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.02e+37) || !(t <= 5.8e+95)) {
tmp = x + 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 ((t <= (-1.02d+37)) .or. (.not. (t <= 5.8d+95))) then
tmp = x + 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 ((t <= -1.02e+37) || !(t <= 5.8e+95)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.02e+37) or not (t <= 5.8e+95): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.02e+37) || !(t <= 5.8e+95)) tmp = Float64(x + 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 ((t <= -1.02e+37) || ~((t <= 5.8e+95))) tmp = x + y; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.02e+37], N[Not[LessEqual[t, 5.8e+95]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{+37} \lor \neg \left(t \leq 5.8 \cdot 10^{+95}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.01999999999999995e37 or 5.80000000000000027e95 < t Initial program 66.4%
associate-*l/91.0%
Simplified91.0%
Taylor expanded in t around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -1.01999999999999995e37 < t < 5.80000000000000027e95Initial program 94.8%
associate-*l/94.8%
Simplified94.8%
Taylor expanded in z around inf 87.9%
*-commutative87.9%
associate-*r/90.1%
Simplified90.1%
Final simplification87.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.6e+38) (not (<= t 7e+96))) (+ x y) (+ x (/ z (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.6e+38) || !(t <= 7e+96)) {
tmp = x + y;
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-5.6d+38)) .or. (.not. (t <= 7d+96))) then
tmp = x + y
else
tmp = x + (z / ((a - t) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.6e+38) || !(t <= 7e+96)) {
tmp = x + y;
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.6e+38) or not (t <= 7e+96): tmp = x + y else: tmp = x + (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.6e+38) || !(t <= 7e+96)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.6e+38) || ~((t <= 7e+96))) tmp = x + y; else tmp = x + (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.6e+38], N[Not[LessEqual[t, 7e+96]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{+38} \lor \neg \left(t \leq 7 \cdot 10^{+96}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -5.6e38 or 6.9999999999999998e96 < t Initial program 66.4%
associate-*l/91.0%
Simplified91.0%
Taylor expanded in t around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -5.6e38 < t < 6.9999999999999998e96Initial program 94.8%
associate-/l*97.2%
Simplified97.2%
div-inv97.0%
*-commutative97.0%
clear-num97.3%
Applied egg-rr97.3%
Taylor expanded in z around inf 87.9%
*-commutative87.9%
associate-/l*90.9%
associate-/r/89.7%
Simplified89.7%
associate-/r/90.9%
Applied egg-rr90.9%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.3e+97) (not (<= t 2.6e+49))) (+ x (* y (/ (- t z) t))) (+ x (/ z (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.3e+97) || !(t <= 2.6e+49)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.3d+97)) .or. (.not. (t <= 2.6d+49))) then
tmp = x + (y * ((t - z) / t))
else
tmp = x + (z / ((a - t) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.3e+97) || !(t <= 2.6e+49)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.3e+97) or not (t <= 2.6e+49): tmp = x + (y * ((t - z) / t)) else: tmp = x + (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.3e+97) || !(t <= 2.6e+49)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); else tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.3e+97) || ~((t <= 2.6e+49))) tmp = x + (y * ((t - z) / t)); else tmp = x + (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.3e+97], N[Not[LessEqual[t, 2.6e+49]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+97} \lor \neg \left(t \leq 2.6 \cdot 10^{+49}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -1.3e97 or 2.59999999999999989e49 < t Initial program 67.4%
associate-/l*99.9%
Simplified99.9%
div-inv99.9%
*-commutative99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 91.0%
associate-*r/91.0%
neg-mul-191.0%
Simplified91.0%
if -1.3e97 < t < 2.59999999999999989e49Initial program 94.2%
associate-/l*97.2%
Simplified97.2%
div-inv97.0%
*-commutative97.0%
clear-num97.3%
Applied egg-rr97.3%
Taylor expanded in z around inf 87.3%
*-commutative87.3%
associate-/l*91.5%
associate-/r/89.7%
Simplified89.7%
associate-/r/91.5%
Applied egg-rr91.5%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.35e+37) (+ x y) (if (<= t 5.8e+48) (+ x (/ z (/ (- a t) y))) (+ x (/ (- t z) (/ t y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.35e+37) {
tmp = x + y;
} else if (t <= 5.8e+48) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + ((t - z) / (t / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.35d+37)) then
tmp = x + y
else if (t <= 5.8d+48) then
tmp = x + (z / ((a - t) / y))
else
tmp = x + ((t - z) / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.35e+37) {
tmp = x + y;
} else if (t <= 5.8e+48) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + ((t - z) / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.35e+37: tmp = x + y elif t <= 5.8e+48: tmp = x + (z / ((a - t) / y)) else: tmp = x + ((t - z) / (t / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.35e+37) tmp = Float64(x + y); elseif (t <= 5.8e+48) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); else tmp = Float64(x + Float64(Float64(t - z) / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.35e+37) tmp = x + y; elseif (t <= 5.8e+48) tmp = x + (z / ((a - t) / y)); else tmp = x + ((t - z) / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.35e+37], N[(x + y), $MachinePrecision], If[LessEqual[t, 5.8e+48], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t - z), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{+37}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+48}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t - z}{\frac{t}{y}}\\
\end{array}
\end{array}
if t < -1.34999999999999993e37Initial program 72.7%
associate-*l/92.2%
Simplified92.2%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -1.34999999999999993e37 < t < 5.7999999999999998e48Initial program 95.1%
associate-/l*97.0%
Simplified97.0%
div-inv96.8%
*-commutative96.8%
clear-num97.1%
Applied egg-rr97.1%
Taylor expanded in z around inf 88.4%
*-commutative88.4%
associate-/l*91.5%
associate-/r/89.7%
Simplified89.7%
associate-/r/91.5%
Applied egg-rr91.5%
if 5.7999999999999998e48 < t Initial program 65.3%
associate-/l*99.9%
Simplified99.9%
div-inv99.9%
*-commutative99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 90.0%
associate-*r/90.0%
neg-mul-190.0%
Simplified90.0%
Taylor expanded in y around 0 60.8%
*-commutative60.8%
associate-/l*82.6%
Simplified82.6%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.35e-57) (+ x (/ y (/ (- t a) t))) (if (<= t 1.06e+49) (+ x (/ z (/ (- a t) y))) (+ x (* y (/ (- t z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.35e-57) {
tmp = x + (y / ((t - a) / t));
} else if (t <= 1.06e+49) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + (y * ((t - 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 (t <= (-1.35d-57)) then
tmp = x + (y / ((t - a) / t))
else if (t <= 1.06d+49) then
tmp = x + (z / ((a - t) / y))
else
tmp = x + (y * ((t - 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 (t <= -1.35e-57) {
tmp = x + (y / ((t - a) / t));
} else if (t <= 1.06e+49) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + (y * ((t - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.35e-57: tmp = x + (y / ((t - a) / t)) elif t <= 1.06e+49: tmp = x + (z / ((a - t) / y)) else: tmp = x + (y * ((t - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.35e-57) tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); elseif (t <= 1.06e+49) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.35e-57) tmp = x + (y / ((t - a) / t)); elseif (t <= 1.06e+49) tmp = x + (z / ((a - t) / y)); else tmp = x + (y * ((t - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.35e-57], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.06e+49], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-57}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\mathbf{elif}\;t \leq 1.06 \cdot 10^{+49}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\end{array}
\end{array}
if t < -1.3500000000000001e-57Initial program 78.6%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 92.5%
mul-1-neg92.5%
Simplified92.5%
if -1.3500000000000001e-57 < t < 1.06e49Initial program 95.2%
associate-/l*96.6%
Simplified96.6%
div-inv96.4%
*-commutative96.4%
clear-num96.7%
Applied egg-rr96.7%
Taylor expanded in z around inf 89.7%
*-commutative89.7%
associate-/l*93.2%
associate-/r/91.2%
Simplified91.2%
associate-/r/93.2%
Applied egg-rr93.2%
if 1.06e49 < t Initial program 65.3%
associate-/l*99.9%
Simplified99.9%
div-inv99.9%
*-commutative99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 90.0%
associate-*r/90.0%
neg-mul-190.0%
Simplified90.0%
Final simplification92.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.5e-50) (+ x (/ y (/ (- t a) t))) (if (<= t 9e+48) (+ x (/ z (/ (- a t) y))) (- x (/ y (/ t (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e-50) {
tmp = x + (y / ((t - a) / t));
} else if (t <= 9e+48) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x - (y / (t / (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 (t <= (-2.5d-50)) then
tmp = x + (y / ((t - a) / t))
else if (t <= 9d+48) then
tmp = x + (z / ((a - t) / y))
else
tmp = x - (y / (t / (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 (t <= -2.5e-50) {
tmp = x + (y / ((t - a) / t));
} else if (t <= 9e+48) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x - (y / (t / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.5e-50: tmp = x + (y / ((t - a) / t)) elif t <= 9e+48: tmp = x + (z / ((a - t) / y)) else: tmp = x - (y / (t / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5e-50) tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); elseif (t <= 9e+48) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); else tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.5e-50) tmp = x + (y / ((t - a) / t)); elseif (t <= 9e+48) tmp = x + (z / ((a - t) / y)); else tmp = x - (y / (t / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5e-50], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+48], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-50}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+48}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\end{array}
\end{array}
if t < -2.49999999999999984e-50Initial program 78.6%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 92.5%
mul-1-neg92.5%
Simplified92.5%
if -2.49999999999999984e-50 < t < 8.99999999999999991e48Initial program 95.2%
associate-/l*96.6%
Simplified96.6%
div-inv96.4%
*-commutative96.4%
clear-num96.7%
Applied egg-rr96.7%
Taylor expanded in z around inf 89.7%
*-commutative89.7%
associate-/l*93.2%
associate-/r/91.2%
Simplified91.2%
associate-/r/93.2%
Applied egg-rr93.2%
if 8.99999999999999991e48 < t Initial program 65.3%
associate-*l/89.9%
Simplified89.9%
Taylor expanded in a around 0 60.8%
+-commutative60.8%
associate-/l*90.0%
associate-*r/90.0%
neg-mul-190.0%
Simplified90.0%
Final simplification92.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.3e+37) (not (<= t 2.25e+18))) (+ x y) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.3e+37) || !(t <= 2.25e+18)) {
tmp = x + y;
} else {
tmp = x + ((z * 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 ((t <= (-1.3d+37)) .or. (.not. (t <= 2.25d+18))) then
tmp = x + y
else
tmp = x + ((z * 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 ((t <= -1.3e+37) || !(t <= 2.25e+18)) {
tmp = x + y;
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.3e+37) or not (t <= 2.25e+18): tmp = x + y else: tmp = x + ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.3e+37) || !(t <= 2.25e+18)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.3e+37) || ~((t <= 2.25e+18))) tmp = x + y; else tmp = x + ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.3e+37], N[Not[LessEqual[t, 2.25e+18]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+37} \lor \neg \left(t \leq 2.25 \cdot 10^{+18}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -1.3e37 or 2.25e18 < t Initial program 68.9%
associate-*l/91.3%
Simplified91.3%
Taylor expanded in t around inf 80.4%
+-commutative80.4%
Simplified80.4%
if -1.3e37 < t < 2.25e18Initial program 95.7%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in t around 0 79.7%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.2e+35) (not (<= t 5.8e+49))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.2e+35) || !(t <= 5.8e+49)) {
tmp = x + y;
} else {
tmp = x + (z * (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 ((t <= (-3.2d+35)) .or. (.not. (t <= 5.8d+49))) then
tmp = x + y
else
tmp = x + (z * (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 ((t <= -3.2e+35) || !(t <= 5.8e+49)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.2e+35) or not (t <= 5.8e+49): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.2e+35) || !(t <= 5.8e+49)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.2e+35) || ~((t <= 5.8e+49))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.2e+35], N[Not[LessEqual[t, 5.8e+49]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+35} \lor \neg \left(t \leq 5.8 \cdot 10^{+49}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -3.19999999999999983e35 or 5.8e49 < t Initial program 68.7%
associate-*l/91.0%
Simplified91.0%
Taylor expanded in t around inf 80.7%
+-commutative80.7%
Simplified80.7%
if -3.19999999999999983e35 < t < 5.8e49Initial program 95.1%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in t around 0 79.0%
+-commutative79.0%
associate-/l*81.9%
Simplified81.9%
associate-/r/81.3%
Applied egg-rr81.3%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.5e+37) (not (<= t 1.6e+49))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.5e+37) || !(t <= 1.6e+49)) {
tmp = x + y;
} else {
tmp = x + (y / (a / 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 ((t <= (-5.5d+37)) .or. (.not. (t <= 1.6d+49))) then
tmp = x + y
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.5e+37) || !(t <= 1.6e+49)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.5e+37) or not (t <= 1.6e+49): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.5e+37) || !(t <= 1.6e+49)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.5e+37) || ~((t <= 1.6e+49))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.5e+37], N[Not[LessEqual[t, 1.6e+49]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+37} \lor \neg \left(t \leq 1.6 \cdot 10^{+49}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -5.50000000000000016e37 or 1.60000000000000007e49 < t Initial program 68.7%
associate-*l/91.0%
Simplified91.0%
Taylor expanded in t around inf 80.7%
+-commutative80.7%
Simplified80.7%
if -5.50000000000000016e37 < t < 1.60000000000000007e49Initial program 95.1%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in t around 0 79.0%
+-commutative79.0%
associate-/l*81.9%
Simplified81.9%
Final simplification81.4%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 84.3%
associate-*l/93.4%
Simplified93.4%
Final simplification93.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.1e+140) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.1e+140) {
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 <= (-3.1d+140)) 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 <= -3.1e+140) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.1e+140: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.1e+140) 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 <= -3.1e+140) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.1e+140], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{+140}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3.1e140Initial program 72.2%
associate-*l/93.7%
Simplified93.7%
Taylor expanded in x around inf 74.9%
if -3.1e140 < a Initial program 85.9%
associate-*l/93.3%
Simplified93.3%
Taylor expanded in t around inf 63.8%
+-commutative63.8%
Simplified63.8%
Final simplification65.1%
(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 84.3%
associate-*l/93.4%
Simplified93.4%
Taylor expanded in x around inf 52.7%
Final simplification52.7%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2023301
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))