
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- a t)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (a - t)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(a - t)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)
\end{array}
Initial program 98.2%
+-commutative98.2%
fma-def98.2%
Simplified98.2%
Final simplification98.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.2e+36) (not (<= t 3.8e+96))) (+ y x) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.2e+36) || !(t <= 3.8e+96)) {
tmp = y + x;
} else {
tmp = x + (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 <= (-4.2d+36)) .or. (.not. (t <= 3.8d+96))) then
tmp = y + x
else
tmp = x + (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 <= -4.2e+36) || !(t <= 3.8e+96)) {
tmp = y + x;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.2e+36) or not (t <= 3.8e+96): tmp = y + x else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.2e+36) || !(t <= 3.8e+96)) tmp = Float64(y + x); else tmp = Float64(x + 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 <= -4.2e+36) || ~((t <= 3.8e+96))) tmp = y + x; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.2e+36], N[Not[LessEqual[t, 3.8e+96]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+36} \lor \neg \left(t \leq 3.8 \cdot 10^{+96}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -4.20000000000000009e36 or 3.8000000000000002e96 < t Initial program 99.9%
Taylor expanded in t around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -4.20000000000000009e36 < t < 3.8000000000000002e96Initial program 97.3%
Taylor expanded in z around inf 87.9%
associate-*r/89.7%
Simplified89.7%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.08e-50) (not (<= t 1.8e+95))) (- x (* y (/ t (- a t)))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.08e-50) || !(t <= 1.8e+95)) {
tmp = x - (y * (t / (a - t)));
} else {
tmp = x + (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.08d-50)) .or. (.not. (t <= 1.8d+95))) then
tmp = x - (y * (t / (a - t)))
else
tmp = x + (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.08e-50) || !(t <= 1.8e+95)) {
tmp = x - (y * (t / (a - t)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.08e-50) or not (t <= 1.8e+95): tmp = x - (y * (t / (a - t))) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.08e-50) || !(t <= 1.8e+95)) tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); else tmp = Float64(x + 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.08e-50) || ~((t <= 1.8e+95))) tmp = x - (y * (t / (a - t))); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.08e-50], N[Not[LessEqual[t, 1.8e+95]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.08 \cdot 10^{-50} \lor \neg \left(t \leq 1.8 \cdot 10^{+95}\right):\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1.0799999999999999e-50 or 1.79999999999999989e95 < t Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 67.3%
associate-*r/82.4%
*-commutative82.4%
associate-/r/89.7%
mul-1-neg89.7%
sub-neg89.7%
associate-/r/82.4%
associate-*l/67.3%
associate-*r/89.7%
Simplified89.7%
if -1.0799999999999999e-50 < t < 1.79999999999999989e95Initial program 96.9%
Taylor expanded in z around inf 89.1%
associate-*r/91.1%
Simplified91.1%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -9.8e-51) (- x (/ y (/ (- a t) t))) (if (<= t 1.95e+96) (+ x (* y (/ z (- a t)))) (- x (* y (/ t (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.8e-51) {
tmp = x - (y / ((a - t) / t));
} else if (t <= 1.95e+96) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x - (y * (t / (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 <= (-9.8d-51)) then
tmp = x - (y / ((a - t) / t))
else if (t <= 1.95d+96) then
tmp = x + (y * (z / (a - t)))
else
tmp = x - (y * (t / (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 <= -9.8e-51) {
tmp = x - (y / ((a - t) / t));
} else if (t <= 1.95e+96) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x - (y * (t / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9.8e-51: tmp = x - (y / ((a - t) / t)) elif t <= 1.95e+96: tmp = x + (y * (z / (a - t))) else: tmp = x - (y * (t / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.8e-51) tmp = Float64(x - Float64(y / Float64(Float64(a - t) / t))); elseif (t <= 1.95e+96) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9.8e-51) tmp = x - (y / ((a - t) / t)); elseif (t <= 1.95e+96) tmp = x + (y * (z / (a - t))); else tmp = x - (y * (t / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.8e-51], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+96], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{-51}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{t}}\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+96}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\end{array}
\end{array}
if t < -9.79999999999999948e-51Initial program 99.9%
Taylor expanded in z around 0 75.4%
+-commutative75.4%
mul-1-neg75.4%
*-commutative75.4%
associate-*r/92.4%
distribute-rgt-neg-out92.4%
distribute-rgt-neg-out92.4%
associate-*r/75.4%
Simplified75.4%
+-commutative75.4%
unsub-neg75.4%
associate-/l*92.5%
Applied egg-rr92.5%
if -9.79999999999999948e-51 < t < 1.95e96Initial program 96.9%
Taylor expanded in z around inf 89.1%
associate-*r/91.1%
Simplified91.1%
if 1.95e96 < t Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 55.8%
associate-*r/77.8%
*-commutative77.8%
associate-/r/85.8%
mul-1-neg85.8%
sub-neg85.8%
associate-/r/77.8%
associate-*l/55.8%
associate-*r/85.8%
Simplified85.8%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.45e-57) (- x (/ y (/ (- a t) t))) (if (<= t 1.72e+77) (+ x (* y (/ z (- a t)))) (+ x (* y (/ (- t z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.45e-57) {
tmp = x - (y / ((a - t) / t));
} else if (t <= 1.72e+77) {
tmp = x + (y * (z / (a - t)));
} 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.45d-57)) then
tmp = x - (y / ((a - t) / t))
else if (t <= 1.72d+77) then
tmp = x + (y * (z / (a - t)))
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.45e-57) {
tmp = x - (y / ((a - t) / t));
} else if (t <= 1.72e+77) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (y * ((t - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.45e-57: tmp = x - (y / ((a - t) / t)) elif t <= 1.72e+77: tmp = x + (y * (z / (a - t))) else: tmp = x + (y * ((t - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.45e-57) tmp = Float64(x - Float64(y / Float64(Float64(a - t) / t))); elseif (t <= 1.72e+77) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); 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 <= -2.45e-57) tmp = x - (y / ((a - t) / t)); elseif (t <= 1.72e+77) tmp = x + (y * (z / (a - t))); else tmp = x + (y * ((t - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.45e-57], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.72e+77], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $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 -2.45 \cdot 10^{-57}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{t}}\\
\mathbf{elif}\;t \leq 1.72 \cdot 10^{+77}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\end{array}
\end{array}
if t < -2.44999999999999994e-57Initial program 99.9%
Taylor expanded in z around 0 75.4%
+-commutative75.4%
mul-1-neg75.4%
*-commutative75.4%
associate-*r/92.4%
distribute-rgt-neg-out92.4%
distribute-rgt-neg-out92.4%
associate-*r/75.4%
Simplified75.4%
+-commutative75.4%
unsub-neg75.4%
associate-/l*92.5%
Applied egg-rr92.5%
if -2.44999999999999994e-57 < t < 1.71999999999999991e77Initial program 96.8%
Taylor expanded in z around inf 88.8%
associate-*r/90.9%
Simplified90.9%
if 1.71999999999999991e77 < t Initial program 99.9%
Taylor expanded in a around 0 92.2%
associate-*r/92.2%
neg-mul-192.2%
Simplified92.2%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.5e-50) (- x (/ y (/ (- a t) t))) (if (<= t 5e+75) (+ x (* y (/ z (- a t)))) (- 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 / ((a - t) / t));
} else if (t <= 5e+75) {
tmp = x + (y * (z / (a - t)));
} 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 / ((a - t) / t))
else if (t <= 5d+75) then
tmp = x + (y * (z / (a - t)))
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 / ((a - t) / t));
} else if (t <= 5e+75) {
tmp = x + (y * (z / (a - t)));
} 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 / ((a - t) / t)) elif t <= 5e+75: tmp = x + (y * (z / (a - t))) 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(a - t) / t))); elseif (t <= 5e+75) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); 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 / ((a - t) / t)); elseif (t <= 5e+75) tmp = x + (y * (z / (a - t))); 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[(a - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e+75], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $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{a - t}{t}}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+75}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\end{array}
\end{array}
if t < -2.49999999999999984e-50Initial program 99.9%
Taylor expanded in z around 0 75.4%
+-commutative75.4%
mul-1-neg75.4%
*-commutative75.4%
associate-*r/92.4%
distribute-rgt-neg-out92.4%
distribute-rgt-neg-out92.4%
associate-*r/75.4%
Simplified75.4%
+-commutative75.4%
unsub-neg75.4%
associate-/l*92.5%
Applied egg-rr92.5%
if -2.49999999999999984e-50 < t < 5.0000000000000002e75Initial program 96.8%
Taylor expanded in z around inf 88.8%
associate-*r/90.9%
Simplified90.9%
if 5.0000000000000002e75 < t Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 60.1%
+-commutative60.1%
associate-/l*92.2%
associate-*r/92.2%
mul-1-neg92.2%
Simplified92.2%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.1e+38) (not (<= t 6.5e+48))) (+ y x) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.1e+38) || !(t <= 6.5e+48)) {
tmp = y + x;
} 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 <= (-2.1d+38)) .or. (.not. (t <= 6.5d+48))) then
tmp = y + x
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 <= -2.1e+38) || !(t <= 6.5e+48)) {
tmp = y + x;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.1e+38) or not (t <= 6.5e+48): tmp = y + x else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.1e+38) || !(t <= 6.5e+48)) tmp = Float64(y + x); 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 <= -2.1e+38) || ~((t <= 6.5e+48))) tmp = y + x; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.1e+38], N[Not[LessEqual[t, 6.5e+48]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+38} \lor \neg \left(t \leq 6.5 \cdot 10^{+48}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.1e38 or 6.49999999999999972e48 < t Initial program 99.9%
Taylor expanded in t around inf 80.7%
+-commutative80.7%
Simplified80.7%
if -2.1e38 < t < 6.49999999999999972e48Initial program 97.1%
Taylor expanded in t around 0 79.0%
+-commutative79.0%
associate-/l*81.9%
associate-/r/81.3%
Simplified81.3%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.85e+36) (not (<= t 5.5e+48))) (+ y x) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.85e+36) || !(t <= 5.5e+48)) {
tmp = y + x;
} 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 <= (-1.85d+36)) .or. (.not. (t <= 5.5d+48))) then
tmp = y + x
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 <= -1.85e+36) || !(t <= 5.5e+48)) {
tmp = y + x;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.85e+36) or not (t <= 5.5e+48): tmp = y + x else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.85e+36) || !(t <= 5.5e+48)) tmp = Float64(y + x); 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 <= -1.85e+36) || ~((t <= 5.5e+48))) tmp = y + x; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.85e+36], N[Not[LessEqual[t, 5.5e+48]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+36} \lor \neg \left(t \leq 5.5 \cdot 10^{+48}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.85000000000000014e36 or 5.5000000000000002e48 < t Initial program 99.9%
Taylor expanded in t around inf 80.7%
+-commutative80.7%
Simplified80.7%
if -1.85000000000000014e36 < t < 5.5000000000000002e48Initial program 97.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 (* 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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 98.2%
Final simplification98.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.25e+140) x (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.25e+140) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.25d+140)) then
tmp = x
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.25e+140) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.25e+140: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.25e+140) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.25e+140) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.25e+140], x, N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.25 \cdot 10^{+140}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -2.2500000000000001e140Initial program 100.0%
Taylor expanded in x around inf 74.9%
if -2.2500000000000001e140 < a Initial program 98.0%
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 98.2%
Taylor expanded in x around inf 52.7%
Final simplification52.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (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) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (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 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023301
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))