
(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 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(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 (+ (* y (/ (- z t) (- a t))) x))
double code(double x, double y, double z, double t, double a) {
return (y * ((z - t) / (a - t))) + x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (y * ((z - t) / (a - t))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y * ((z - t) / (a - t))) + x;
}
def code(x, y, z, t, a): return (y * ((z - t) / (a - t))) + x
function code(x, y, z, t, a) return Float64(Float64(y * Float64(Float64(z - t) / Float64(a - t))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y * ((z - t) / (a - t))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{z - t}{a - t} + x
\end{array}
Initial program 88.9%
+-commutative88.9%
associate-*r/97.6%
fma-def97.6%
Simplified97.6%
fma-udef97.6%
Applied egg-rr97.6%
Final simplification97.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e+205) (not (<= t 1.3e+219))) (+ x (/ y (/ t (- t z)))) (+ x (* (- z t) (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+205) || !(t <= 1.3e+219)) {
tmp = x + (y / (t / (t - z)));
} else {
tmp = x + ((z - t) * (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 <= (-2.2d+205)) .or. (.not. (t <= 1.3d+219))) then
tmp = x + (y / (t / (t - z)))
else
tmp = x + ((z - t) * (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 <= -2.2e+205) || !(t <= 1.3e+219)) {
tmp = x + (y / (t / (t - z)));
} else {
tmp = x + ((z - t) * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e+205) or not (t <= 1.3e+219): tmp = x + (y / (t / (t - z))) else: tmp = x + ((z - t) * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e+205) || !(t <= 1.3e+219)) tmp = Float64(x + Float64(y / Float64(t / Float64(t - z)))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.2e+205) || ~((t <= 1.3e+219))) tmp = x + (y / (t / (t - z))); else tmp = x + ((z - t) * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e+205], N[Not[LessEqual[t, 1.3e+219]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+205} \lor \neg \left(t \leq 1.3 \cdot 10^{+219}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -2.1999999999999998e205 or 1.3e219 < t Initial program 66.5%
+-commutative66.5%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
fma-udef99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 64.9%
associate-*r/64.9%
neg-mul-164.9%
distribute-rgt-neg-in64.9%
associate-/l*98.5%
neg-sub098.5%
associate--r-98.5%
neg-sub098.5%
Simplified98.5%
Taylor expanded in y around 0 64.9%
associate-/l*98.5%
Simplified98.5%
if -2.1999999999999998e205 < t < 1.3e219Initial program 93.3%
associate-*l/97.2%
Simplified97.2%
Final simplification97.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.5e-42)
(+ y x)
(if (<= t 1e-80)
(+ x (/ y (/ a z)))
(if (<= t 1.4e+44) (- x (* z (/ y t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e-42) {
tmp = y + x;
} else if (t <= 1e-80) {
tmp = x + (y / (a / z));
} else if (t <= 1.4e+44) {
tmp = x - (z * (y / t));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2.5d-42)) then
tmp = y + x
else if (t <= 1d-80) then
tmp = x + (y / (a / z))
else if (t <= 1.4d+44) then
tmp = x - (z * (y / t))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e-42) {
tmp = y + x;
} else if (t <= 1e-80) {
tmp = x + (y / (a / z));
} else if (t <= 1.4e+44) {
tmp = x - (z * (y / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.5e-42: tmp = y + x elif t <= 1e-80: tmp = x + (y / (a / z)) elif t <= 1.4e+44: tmp = x - (z * (y / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5e-42) tmp = Float64(y + x); elseif (t <= 1e-80) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 1.4e+44) tmp = Float64(x - Float64(z * Float64(y / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.5e-42) tmp = y + x; elseif (t <= 1e-80) tmp = x + (y / (a / z)); elseif (t <= 1.4e+44) tmp = x - (z * (y / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5e-42], N[(y + x), $MachinePrecision], If[LessEqual[t, 1e-80], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+44], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-42}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 10^{-80}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+44}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.50000000000000001e-42 or 1.4e44 < t Initial program 80.3%
+-commutative80.3%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 78.5%
if -2.50000000000000001e-42 < t < 9.99999999999999961e-81Initial program 97.3%
+-commutative97.3%
associate-*r/96.1%
fma-def96.1%
Simplified96.1%
Taylor expanded in t around 0 83.4%
associate-/l*85.2%
Simplified85.2%
if 9.99999999999999961e-81 < t < 1.4e44Initial program 99.8%
associate-/l*90.4%
Simplified90.4%
Taylor expanded in z around inf 75.9%
Taylor expanded in a around 0 75.6%
associate-*r/75.6%
associate-*r*75.6%
*-commutative75.6%
neg-mul-175.6%
Simplified75.6%
div-inv75.6%
*-commutative75.6%
*-commutative75.6%
add-sqr-sqrt20.0%
sqrt-unprod55.4%
sqr-neg55.4%
sqrt-unprod35.7%
add-sqr-sqrt45.7%
distribute-lft-neg-in45.7%
cancel-sign-sub-inv45.7%
associate-*l*45.7%
add-sqr-sqrt10.1%
sqrt-unprod50.6%
sqr-neg50.6%
sqrt-unprod50.1%
add-sqr-sqrt75.6%
div-inv75.7%
Applied egg-rr75.7%
Final simplification81.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e-40) (not (<= t 800.0))) (+ x (/ y (/ t (- t z)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e-40) || !(t <= 800.0)) {
tmp = x + (y / (t / (t - z)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.4d-40)) .or. (.not. (t <= 800.0d0))) then
tmp = x + (y / (t / (t - z)))
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e-40) || !(t <= 800.0)) {
tmp = x + (y / (t / (t - z)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.4e-40) or not (t <= 800.0): tmp = x + (y / (t / (t - z))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e-40) || !(t <= 800.0)) tmp = Float64(x + Float64(y / Float64(t / Float64(t - z)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.4e-40) || ~((t <= 800.0))) tmp = x + (y / (t / (t - z))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e-40], N[Not[LessEqual[t, 800.0]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{-40} \lor \neg \left(t \leq 800\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -3.39999999999999984e-40 or 800 < t Initial program 81.2%
+-commutative81.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
fma-udef99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 71.8%
associate-*r/71.8%
neg-mul-171.8%
distribute-rgt-neg-in71.8%
associate-/l*89.2%
neg-sub089.2%
associate--r-89.2%
neg-sub089.2%
Simplified89.2%
Taylor expanded in y around 0 71.8%
associate-/l*89.2%
Simplified89.2%
if -3.39999999999999984e-40 < t < 800Initial program 97.6%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in z around inf 92.2%
associate-*l/93.0%
*-commutative93.0%
Simplified93.0%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.8e+53) (+ y x) (if (<= t 1.02e+43) (+ x (* z (/ y (- a t)))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.8e+53) {
tmp = y + x;
} else if (t <= 1.02e+43) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-6.8d+53)) then
tmp = y + x
else if (t <= 1.02d+43) then
tmp = x + (z * (y / (a - t)))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.8e+53) {
tmp = y + x;
} else if (t <= 1.02e+43) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.8e+53: tmp = y + x elif t <= 1.02e+43: tmp = x + (z * (y / (a - t))) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.8e+53) tmp = Float64(y + x); elseif (t <= 1.02e+43) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.8e+53) tmp = y + x; elseif (t <= 1.02e+43) tmp = x + (z * (y / (a - t))); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.8e+53], N[(y + x), $MachinePrecision], If[LessEqual[t, 1.02e+43], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+53}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+43}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -6.79999999999999995e53 or 1.02e43 < t Initial program 76.0%
+-commutative76.0%
associate-*r/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in t around inf 83.9%
if -6.79999999999999995e53 < t < 1.02e43Initial program 97.5%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in z around inf 87.5%
associate-*l/88.8%
*-commutative88.8%
Simplified88.8%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.2e-39) (+ x (/ y (/ t (- t z)))) (if (<= t 8.5e-37) (+ x (* z (/ y (- a t)))) (- x (/ y (+ (/ a t) -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.2e-39) {
tmp = x + (y / (t / (t - z)));
} else if (t <= 8.5e-37) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y / ((a / t) + -1.0));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.2d-39)) then
tmp = x + (y / (t / (t - z)))
else if (t <= 8.5d-37) then
tmp = x + (z * (y / (a - t)))
else
tmp = x - (y / ((a / t) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.2e-39) {
tmp = x + (y / (t / (t - z)));
} else if (t <= 8.5e-37) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y / ((a / t) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.2e-39: tmp = x + (y / (t / (t - z))) elif t <= 8.5e-37: tmp = x + (z * (y / (a - t))) else: tmp = x - (y / ((a / t) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.2e-39) tmp = Float64(x + Float64(y / Float64(t / Float64(t - z)))); elseif (t <= 8.5e-37) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.2e-39) tmp = x + (y / (t / (t - z))); elseif (t <= 8.5e-37) tmp = x + (z * (y / (a - t))); else tmp = x - (y / ((a / t) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.2e-39], N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-37], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-39}:\\
\;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-37}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\end{array}
\end{array}
if t < -1.20000000000000008e-39Initial program 81.2%
+-commutative81.2%
associate-*r/99.8%
fma-def99.8%
Simplified99.8%
fma-udef99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 72.6%
associate-*r/72.6%
neg-mul-172.6%
distribute-rgt-neg-in72.6%
associate-/l*90.2%
neg-sub090.2%
associate--r-90.2%
neg-sub090.2%
Simplified90.2%
Taylor expanded in y around 0 72.6%
associate-/l*90.2%
Simplified90.2%
if -1.20000000000000008e-39 < t < 8.5000000000000007e-37Initial program 97.5%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in z around inf 92.8%
associate-*l/93.6%
*-commutative93.6%
Simplified93.6%
if 8.5000000000000007e-37 < t Initial program 82.1%
+-commutative82.1%
associate-*r/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in z around 0 73.3%
+-commutative73.3%
mul-1-neg73.3%
unsub-neg73.3%
associate-/l*91.3%
div-sub91.3%
sub-neg91.3%
*-inverses91.3%
metadata-eval91.3%
Simplified91.3%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.7e-42) (not (<= t 490.0))) (+ y x) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.7e-42) || !(t <= 490.0)) {
tmp = y + x;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.7d-42)) .or. (.not. (t <= 490.0d0))) then
tmp = y + x
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.7e-42) || !(t <= 490.0)) {
tmp = y + x;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.7e-42) or not (t <= 490.0): tmp = y + x else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.7e-42) || !(t <= 490.0)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.7e-42) || ~((t <= 490.0))) tmp = y + x; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.7e-42], N[Not[LessEqual[t, 490.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{-42} \lor \neg \left(t \leq 490\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -4.7000000000000001e-42 or 490 < t Initial program 81.2%
+-commutative81.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 77.3%
if -4.7000000000000001e-42 < t < 490Initial program 97.6%
+-commutative97.6%
associate-*r/95.0%
fma-def95.0%
Simplified95.0%
fma-udef95.0%
Applied egg-rr95.0%
Taylor expanded in t around 0 81.3%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.6e-40) (+ y x) (if (<= t 860.0) (+ x (/ y (/ a z))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.6e-40) {
tmp = y + x;
} else if (t <= 860.0) {
tmp = x + (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 (t <= (-2.6d-40)) then
tmp = y + x
else if (t <= 860.0d0) then
tmp = x + (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 (t <= -2.6e-40) {
tmp = y + x;
} else if (t <= 860.0) {
tmp = x + (y / (a / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.6e-40: tmp = y + x elif t <= 860.0: tmp = x + (y / (a / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.6e-40) tmp = Float64(y + x); elseif (t <= 860.0) tmp = Float64(x + 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 (t <= -2.6e-40) tmp = y + x; elseif (t <= 860.0) tmp = x + (y / (a / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.6e-40], N[(y + x), $MachinePrecision], If[LessEqual[t, 860.0], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{-40}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 860:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.6000000000000001e-40 or 860 < t Initial program 81.2%
+-commutative81.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 77.3%
if -2.6000000000000001e-40 < t < 860Initial program 97.6%
+-commutative97.6%
associate-*r/95.0%
fma-def95.0%
Simplified95.0%
Taylor expanded in t around 0 79.8%
associate-/l*81.3%
Simplified81.3%
Final simplification79.2%
(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}
Initial program 88.9%
associate-/l*97.5%
Simplified97.5%
Final simplification97.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.5e-43) (+ y x) (if (<= t 95.0) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e-43) {
tmp = y + x;
} else if (t <= 95.0) {
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 (t <= (-4.5d-43)) then
tmp = y + x
else if (t <= 95.0d0) 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 (t <= -4.5e-43) {
tmp = y + x;
} else if (t <= 95.0) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.5e-43: tmp = y + x elif t <= 95.0: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.5e-43) tmp = Float64(y + x); elseif (t <= 95.0) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.5e-43) tmp = y + x; elseif (t <= 95.0) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.5e-43], N[(y + x), $MachinePrecision], If[LessEqual[t, 95.0], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-43}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 95:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -4.50000000000000025e-43 or 95 < t Initial program 81.2%
+-commutative81.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 77.3%
if -4.50000000000000025e-43 < t < 95Initial program 97.6%
+-commutative97.6%
associate-*r/95.0%
fma-def95.0%
Simplified95.0%
Taylor expanded in y around 0 52.1%
Final simplification65.4%
(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 88.9%
+-commutative88.9%
associate-*r/97.6%
fma-def97.6%
Simplified97.6%
Taylor expanded in y around 0 50.5%
Final simplification50.5%
(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 2023181
(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))))