
(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 11 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 82.3%
+-commutative82.3%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.6e-68) (not (<= z 6e-96))) (+ x (* y (/ z (- z a)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.6e-68) || !(z <= 6e-96)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (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 ((z <= (-9.6d-68)) .or. (.not. (z <= 6d-96))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (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 ((z <= -9.6e-68) || !(z <= 6e-96)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.6e-68) or not (z <= 6e-96): tmp = x + (y * (z / (z - a))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.6e-68) || !(z <= 6e-96)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.6e-68) || ~((z <= 6e-96))) tmp = x + (y * (z / (z - a))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.6e-68], N[Not[LessEqual[z, 6e-96]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-68} \lor \neg \left(z \leq 6 \cdot 10^{-96}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -9.59999999999999965e-68 or 6e-96 < z Initial program 77.2%
+-commutative77.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around 0 67.7%
+-commutative67.7%
associate-*l/81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in y around 0 67.7%
*-commutative67.7%
associate-/l*81.8%
associate-/r/85.2%
Simplified85.2%
if -9.59999999999999965e-68 < z < 6e-96Initial program 91.6%
+-commutative91.6%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around 0 83.9%
+-commutative83.9%
associate-/l*91.2%
Simplified91.2%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.2e-8) (+ y x) (if (<= z 49000.0) (+ x (/ y (/ a t))) (+ x (* z (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e-8) {
tmp = y + x;
} else if (z <= 49000.0) {
tmp = x + (y / (a / t));
} else {
tmp = x + (z * (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 (z <= (-7.2d-8)) then
tmp = y + x
else if (z <= 49000.0d0) then
tmp = x + (y / (a / t))
else
tmp = x + (z * (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 (z <= -7.2e-8) {
tmp = y + x;
} else if (z <= 49000.0) {
tmp = x + (y / (a / t));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.2e-8: tmp = y + x elif z <= 49000.0: tmp = x + (y / (a / t)) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.2e-8) tmp = Float64(y + x); elseif (z <= 49000.0) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.2e-8) tmp = y + x; elseif (z <= 49000.0) tmp = x + (y / (a / t)); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.2e-8], N[(y + x), $MachinePrecision], If[LessEqual[z, 49000.0], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-8}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 49000:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -7.19999999999999962e-8Initial program 79.0%
+-commutative79.0%
associate-*r/99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in z around inf 79.1%
if -7.19999999999999962e-8 < z < 49000Initial program 91.8%
+-commutative91.8%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around 0 77.4%
+-commutative77.4%
associate-/l*84.8%
Simplified84.8%
if 49000 < z Initial program 67.0%
+-commutative67.0%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around 0 62.5%
+-commutative62.5%
associate-*l/90.9%
*-commutative90.9%
Simplified90.9%
Final simplification84.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.4e-5) (+ x (/ y (/ z (- z t)))) (if (<= z 2.1e-91) (+ x (* y (/ t a))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-5) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 2.1e-91) {
tmp = x + (y * (t / 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 <= (-2.4d-5)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 2.1d-91) then
tmp = x + (y * (t / 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 <= -2.4e-5) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 2.1e-91) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.4e-5: tmp = x + (y / (z / (z - t))) elif z <= 2.1e-91: tmp = x + (y * (t / a)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e-5) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 2.1e-91) tmp = Float64(x + Float64(y * Float64(t / 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 <= -2.4e-5) tmp = x + (y / (z / (z - t))); elseif (z <= 2.1e-91) tmp = x + (y * (t / a)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e-5], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-91], N[(x + N[(y * N[(t / 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 -2.4 \cdot 10^{-5}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-91}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -2.4000000000000001e-5Initial program 79.0%
+-commutative79.0%
associate-*r/99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in a around 0 72.1%
*-commutative72.1%
associate-/l*91.7%
Simplified91.7%
if -2.4000000000000001e-5 < z < 2.0999999999999999e-91Initial program 91.8%
associate-/l*99.9%
Simplified99.9%
frac-2neg99.9%
div-inv99.9%
distribute-neg-frac99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 82.2%
associate-/l*89.5%
Simplified89.5%
div-inv89.4%
clear-num89.5%
Applied egg-rr89.5%
if 2.0999999999999999e-91 < z Initial program 73.4%
+-commutative73.4%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around 0 64.7%
+-commutative64.7%
associate-*l/83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in y around 0 64.7%
*-commutative64.7%
associate-/l*84.6%
associate-/r/85.8%
Simplified85.8%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -0.00016) (+ x (* y (- 1.0 (/ t z)))) (if (<= z 9e-87) (+ x (* y (/ t a))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.00016) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= 9e-87) {
tmp = x + (y * (t / 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 <= (-0.00016d0)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if (z <= 9d-87) then
tmp = x + (y * (t / 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 <= -0.00016) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= 9e-87) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -0.00016: tmp = x + (y * (1.0 - (t / z))) elif z <= 9e-87: tmp = x + (y * (t / a)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.00016) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (z <= 9e-87) tmp = Float64(x + Float64(y * Float64(t / 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 <= -0.00016) tmp = x + (y * (1.0 - (t / z))); elseif (z <= 9e-87) tmp = x + (y * (t / a)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.00016], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-87], N[(x + N[(y * N[(t / 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 -0.00016:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-87}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -1.60000000000000013e-4Initial program 79.0%
associate-/l*99.8%
Simplified99.8%
frac-2neg99.8%
div-inv99.8%
distribute-neg-frac99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 72.1%
*-commutative72.1%
*-commutative72.1%
*-lft-identity72.1%
times-frac91.7%
/-rgt-identity91.7%
div-sub91.7%
*-inverses91.7%
Simplified91.7%
if -1.60000000000000013e-4 < z < 8.99999999999999915e-87Initial program 91.8%
associate-/l*99.9%
Simplified99.9%
frac-2neg99.9%
div-inv99.9%
distribute-neg-frac99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 82.2%
associate-/l*89.5%
Simplified89.5%
div-inv89.4%
clear-num89.5%
Applied egg-rr89.5%
if 8.99999999999999915e-87 < z Initial program 73.4%
+-commutative73.4%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around 0 64.7%
+-commutative64.7%
associate-*l/83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in y around 0 64.7%
*-commutative64.7%
associate-/l*84.6%
associate-/r/85.8%
Simplified85.8%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -0.00048) (+ y x) (if (<= z 2.9e+16) (+ x (/ y (/ a t))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.00048) {
tmp = y + x;
} else if (z <= 2.9e+16) {
tmp = x + (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 (z <= (-0.00048d0)) then
tmp = y + x
else if (z <= 2.9d+16) then
tmp = x + (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 (z <= -0.00048) {
tmp = y + x;
} else if (z <= 2.9e+16) {
tmp = x + (y / (a / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -0.00048: tmp = y + x elif z <= 2.9e+16: tmp = x + (y / (a / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.00048) tmp = Float64(y + x); elseif (z <= 2.9e+16) tmp = Float64(x + 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 (z <= -0.00048) tmp = y + x; elseif (z <= 2.9e+16) tmp = x + (y / (a / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.00048], N[(y + x), $MachinePrecision], If[LessEqual[z, 2.9e+16], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00048:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+16}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -4.80000000000000012e-4 or 2.9e16 < z Initial program 73.2%
+-commutative73.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around inf 78.0%
if -4.80000000000000012e-4 < z < 2.9e16Initial program 91.8%
+-commutative91.8%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around 0 77.4%
+-commutative77.4%
associate-/l*84.8%
Simplified84.8%
Final simplification81.3%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Initial program 82.3%
associate-*l/96.5%
Simplified96.5%
Final simplification96.5%
(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}
Initial program 82.3%
associate-/l*99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.42e+165) x (if (<= a 1.15e+206) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.42e+165) {
tmp = x;
} else if (a <= 1.15e+206) {
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 <= (-1.42d+165)) then
tmp = x
else if (a <= 1.15d+206) 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 <= -1.42e+165) {
tmp = x;
} else if (a <= 1.15e+206) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.42e+165: tmp = x elif a <= 1.15e+206: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.42e+165) tmp = x; elseif (a <= 1.15e+206) 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 <= -1.42e+165) tmp = x; elseif (a <= 1.15e+206) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.42e+165], x, If[LessEqual[a, 1.15e+206], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.42 \cdot 10^{+165}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+206}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.42e165 or 1.15000000000000008e206 < a Initial program 80.2%
+-commutative80.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around 0 78.8%
if -1.42e165 < a < 1.15000000000000008e206Initial program 82.8%
+-commutative82.8%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around inf 66.6%
Final simplification68.9%
(FPCore (x y z t a) :precision binary64 (if (<= x -1e-191) x (if (<= x 5.5e-102) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1e-191) {
tmp = x;
} else if (x <= 5.5e-102) {
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 <= (-1d-191)) then
tmp = x
else if (x <= 5.5d-102) 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 <= -1e-191) {
tmp = x;
} else if (x <= 5.5e-102) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1e-191: tmp = x elif x <= 5.5e-102: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1e-191) tmp = x; elseif (x <= 5.5e-102) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1e-191) tmp = x; elseif (x <= 5.5e-102) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1e-191], x, If[LessEqual[x, 5.5e-102], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-191}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-102}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1e-191 or 5.4999999999999997e-102 < x Initial program 84.2%
+-commutative84.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around 0 64.0%
if -1e-191 < x < 5.4999999999999997e-102Initial program 76.7%
+-commutative76.7%
associate-*r/99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in x around 0 65.4%
Taylor expanded in z around inf 39.0%
*-commutative39.0%
Simplified39.0%
Taylor expanded in z around inf 50.0%
Final simplification60.5%
(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 82.3%
+-commutative82.3%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around 0 50.9%
Final simplification50.9%
(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 2023195
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))