
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 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(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- t z) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (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 * ((t - z) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{z - a}
\end{array}
Initial program 99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.1e+180)
(+ x y)
(if (<= z -5.1e-8)
(- x (* y (/ t z)))
(if (or (<= z -6.4e-37) (not (<= z 1.82e-6)))
(+ x y)
(+ x (/ t (/ a y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+180) {
tmp = x + y;
} else if (z <= -5.1e-8) {
tmp = x - (y * (t / z));
} else if ((z <= -6.4e-37) || !(z <= 1.82e-6)) {
tmp = x + y;
} else {
tmp = x + (t / (a / 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 (z <= (-1.1d+180)) then
tmp = x + y
else if (z <= (-5.1d-8)) then
tmp = x - (y * (t / z))
else if ((z <= (-6.4d-37)) .or. (.not. (z <= 1.82d-6))) then
tmp = x + y
else
tmp = x + (t / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+180) {
tmp = x + y;
} else if (z <= -5.1e-8) {
tmp = x - (y * (t / z));
} else if ((z <= -6.4e-37) || !(z <= 1.82e-6)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+180: tmp = x + y elif z <= -5.1e-8: tmp = x - (y * (t / z)) elif (z <= -6.4e-37) or not (z <= 1.82e-6): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+180) tmp = Float64(x + y); elseif (z <= -5.1e-8) tmp = Float64(x - Float64(y * Float64(t / z))); elseif ((z <= -6.4e-37) || !(z <= 1.82e-6)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+180) tmp = x + y; elseif (z <= -5.1e-8) tmp = x - (y * (t / z)); elseif ((z <= -6.4e-37) || ~((z <= 1.82e-6))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+180], N[(x + y), $MachinePrecision], If[LessEqual[z, -5.1e-8], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -6.4e-37], N[Not[LessEqual[z, 1.82e-6]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+180}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-8}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-37} \lor \neg \left(z \leq 1.82 \cdot 10^{-6}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.1e180 or -5.10000000000000001e-8 < z < -6.3999999999999998e-37 or 1.8199999999999999e-6 < z Initial program 98.9%
Taylor expanded in z around inf 83.5%
+-commutative83.5%
Simplified83.5%
if -1.1e180 < z < -5.10000000000000001e-8Initial program 99.9%
Taylor expanded in a around 0 77.2%
Taylor expanded in z around 0 71.5%
associate-*r/71.5%
associate-*r*71.5%
neg-mul-171.5%
Simplified71.5%
div-inv71.5%
add-sqr-sqrt57.0%
sqrt-unprod63.6%
distribute-lft-neg-out63.6%
distribute-lft-neg-out63.6%
sqr-neg63.6%
sqrt-unprod28.5%
add-sqr-sqrt51.1%
cancel-sign-sub51.1%
distribute-lft-neg-out51.1%
div-inv51.1%
associate-/l*53.1%
associate-/r/53.1%
add-sqr-sqrt24.9%
sqrt-unprod53.7%
sqr-neg53.7%
sqrt-unprod36.6%
add-sqr-sqrt73.5%
Applied egg-rr73.5%
if -6.3999999999999998e-37 < z < 1.8199999999999999e-6Initial program 99.1%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
associate-/l*85.2%
Simplified85.2%
Final simplification82.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2e+58)
(+ x (* y (- 1.0 (/ t z))))
(if (or (<= z -1.04e-44) (not (<= z 4.8e-13)))
(+ x (* y (/ z (- z a))))
(+ x (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+58) {
tmp = x + (y * (1.0 - (t / z)));
} else if ((z <= -1.04e-44) || !(z <= 4.8e-13)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t / (a / 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 (z <= (-2d+58)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if ((z <= (-1.04d-44)) .or. (.not. (z <= 4.8d-13))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (t / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+58) {
tmp = x + (y * (1.0 - (t / z)));
} else if ((z <= -1.04e-44) || !(z <= 4.8e-13)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e+58: tmp = x + (y * (1.0 - (t / z))) elif (z <= -1.04e-44) or not (z <= 4.8e-13): tmp = x + (y * (z / (z - a))) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+58) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif ((z <= -1.04e-44) || !(z <= 4.8e-13)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2e+58) tmp = x + (y * (1.0 - (t / z))); elseif ((z <= -1.04e-44) || ~((z <= 4.8e-13))) tmp = x + (y * (z / (z - a))); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+58], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.04e-44], N[Not[LessEqual[z, 4.8e-13]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+58}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq -1.04 \cdot 10^{-44} \lor \neg \left(z \leq 4.8 \cdot 10^{-13}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.99999999999999989e58Initial program 99.9%
Taylor expanded in a around 0 90.9%
div-sub90.9%
*-inverses90.9%
Simplified90.9%
if -1.99999999999999989e58 < z < -1.03999999999999995e-44 or 4.7999999999999997e-13 < z Initial program 98.9%
Taylor expanded in t around 0 88.2%
if -1.03999999999999995e-44 < z < 4.7999999999999997e-13Initial program 99.1%
Taylor expanded in z around 0 81.4%
+-commutative81.4%
associate-/l*85.7%
Simplified85.7%
Final simplification87.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.85e+58)
(+ x (* y (- 1.0 (/ t z))))
(if (<= z -2.2e-43)
(+ x (/ y (/ (- z a) z)))
(if (<= z 3.8e-15) (+ x (/ t (/ a y))) (+ x (* y (/ z (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+58) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= -2.2e-43) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 3.8e-15) {
tmp = x + (t / (a / y));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.85d+58)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if (z <= (-2.2d-43)) then
tmp = x + (y / ((z - a) / z))
else if (z <= 3.8d-15) then
tmp = x + (t / (a / y))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+58) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= -2.2e-43) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 3.8e-15) {
tmp = x + (t / (a / y));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.85e+58: tmp = x + (y * (1.0 - (t / z))) elif z <= -2.2e-43: tmp = x + (y / ((z - a) / z)) elif z <= 3.8e-15: tmp = x + (t / (a / y)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+58) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (z <= -2.2e-43) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= 3.8e-15) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.85e+58) tmp = x + (y * (1.0 - (t / z))); elseif (z <= -2.2e-43) tmp = x + (y / ((z - a) / z)); elseif (z <= 3.8e-15) tmp = x + (t / (a / y)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+58], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e-43], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-15], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+58}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-43}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -1.8500000000000001e58Initial program 99.9%
Taylor expanded in a around 0 90.9%
div-sub90.9%
*-inverses90.9%
Simplified90.9%
if -1.8500000000000001e58 < z < -2.19999999999999997e-43Initial program 96.6%
Taylor expanded in t around 0 79.6%
+-commutative79.6%
associate-/l*82.9%
Simplified82.9%
if -2.19999999999999997e-43 < z < 3.8000000000000002e-15Initial program 99.1%
Taylor expanded in z around 0 81.4%
+-commutative81.4%
associate-/l*85.7%
Simplified85.7%
if 3.8000000000000002e-15 < z Initial program 100.0%
Taylor expanded in t around 0 90.7%
Final simplification87.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e-37) (not (<= z 1.65e-40))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e-37) || !(z <= 1.65e-40)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.8d-37)) .or. (.not. (z <= 1.65d-40))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e-37) || !(z <= 1.65e-40)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e-37) or not (z <= 1.65e-40): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e-37) || !(z <= 1.65e-40)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.8e-37) || ~((z <= 1.65e-40))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e-37], N[Not[LessEqual[z, 1.65e-40]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-37} \lor \neg \left(z \leq 1.65 \cdot 10^{-40}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -4.79999999999999982e-37 or 1.64999999999999996e-40 < z Initial program 99.3%
Taylor expanded in a around 0 84.8%
div-sub84.8%
*-inverses84.8%
Simplified84.8%
if -4.79999999999999982e-37 < z < 1.64999999999999996e-40Initial program 99.0%
Taylor expanded in z around 0 81.2%
+-commutative81.2%
associate-/l*85.8%
Simplified85.8%
clear-num85.8%
associate-/r/85.8%
clear-num85.9%
Applied egg-rr85.9%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e+80) (not (<= z 8.2e-41))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* (/ y a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+80) || !(z <= 8.2e-41)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y / a) * (t - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.6d+80)) .or. (.not. (z <= 8.2d-41))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + ((y / a) * (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+80) || !(z <= 8.2e-41)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y / a) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e+80) or not (z <= 8.2e-41): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + ((y / a) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e+80) || !(z <= 8.2e-41)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.6e+80) || ~((z <= 8.2e-41))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + ((y / a) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e+80], N[Not[LessEqual[z, 8.2e-41]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+80} \lor \neg \left(z \leq 8.2 \cdot 10^{-41}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if z < -2.59999999999999982e80 or 8.20000000000000028e-41 < z Initial program 100.0%
Taylor expanded in a around 0 90.3%
div-sub90.3%
*-inverses90.3%
Simplified90.3%
if -2.59999999999999982e80 < z < 8.20000000000000028e-41Initial program 98.6%
Taylor expanded in a around inf 78.1%
mul-1-neg78.1%
unsub-neg78.1%
associate-/l*82.7%
associate-/r/83.3%
Simplified83.3%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.1e-64) (not (<= z 4.2e-7))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.1e-64) || !(z <= 4.2e-7)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.1d-64)) .or. (.not. (z <= 4.2d-7))) then
tmp = x + y
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.1e-64) || !(z <= 4.2e-7)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.1e-64) or not (z <= 4.2e-7): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.1e-64) || !(z <= 4.2e-7)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.1e-64) || ~((z <= 4.2e-7))) tmp = x + y; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.1e-64], N[Not[LessEqual[z, 4.2e-7]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{-64} \lor \neg \left(z \leq 4.2 \cdot 10^{-7}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -4.1e-64 or 4.2e-7 < z Initial program 99.3%
Taylor expanded in z around inf 75.7%
+-commutative75.7%
Simplified75.7%
if -4.1e-64 < z < 4.2e-7Initial program 99.1%
Taylor expanded in z around 0 81.9%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.3e-37) (not (<= z 0.0265))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.3e-37) || !(z <= 0.0265)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-7.3d-37)) .or. (.not. (z <= 0.0265d0))) then
tmp = x + y
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.3e-37) || !(z <= 0.0265)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.3e-37) or not (z <= 0.0265): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.3e-37) || !(z <= 0.0265)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.3e-37) || ~((z <= 0.0265))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.3e-37], N[Not[LessEqual[z, 0.0265]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.3 \cdot 10^{-37} \lor \neg \left(z \leq 0.0265\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -7.2999999999999997e-37 or 0.0264999999999999993 < z Initial program 99.3%
Taylor expanded in z around inf 76.2%
+-commutative76.2%
Simplified76.2%
if -7.2999999999999997e-37 < z < 0.0264999999999999993Initial program 99.1%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
associate-/l*85.2%
associate-/r/83.8%
Simplified83.8%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.3e-37) (not (<= z 6e-31))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.3e-37) || !(z <= 6e-31)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-5.3d-37)) .or. (.not. (z <= 6d-31))) then
tmp = x + y
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.3e-37) || !(z <= 6e-31)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.3e-37) or not (z <= 6e-31): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.3e-37) || !(z <= 6e-31)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.3e-37) || ~((z <= 6e-31))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.3e-37], N[Not[LessEqual[z, 6e-31]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{-37} \lor \neg \left(z \leq 6 \cdot 10^{-31}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.29999999999999995e-37 or 5.99999999999999962e-31 < z Initial program 99.3%
Taylor expanded in z around inf 75.8%
+-commutative75.8%
Simplified75.8%
if -5.29999999999999995e-37 < z < 5.99999999999999962e-31Initial program 99.1%
Taylor expanded in z around 0 80.9%
+-commutative80.9%
associate-/l*85.3%
Simplified85.3%
clear-num85.3%
associate-/r/85.3%
clear-num85.4%
Applied egg-rr85.4%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e-43) (not (<= z 25.0))) (+ x y) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e-43) || !(z <= 25.0)) {
tmp = x + y;
} else {
tmp = x + (t / (a / 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 ((z <= (-4.5d-43)) .or. (.not. (z <= 25.0d0))) then
tmp = x + y
else
tmp = x + (t / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e-43) || !(z <= 25.0)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e-43) or not (z <= 25.0): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e-43) || !(z <= 25.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.5e-43) || ~((z <= 25.0))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e-43], N[Not[LessEqual[z, 25.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-43} \lor \neg \left(z \leq 25\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -4.50000000000000025e-43 or 25 < z Initial program 99.3%
Taylor expanded in z around inf 76.2%
+-commutative76.2%
Simplified76.2%
if -4.50000000000000025e-43 < z < 25Initial program 99.1%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
associate-/l*85.2%
Simplified85.2%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8e-106) (not (<= z 1.12e-114))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e-106) || !(z <= 1.12e-114)) {
tmp = x + 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 ((z <= (-8d-106)) .or. (.not. (z <= 1.12d-114))) then
tmp = x + 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 ((z <= -8e-106) || !(z <= 1.12e-114)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8e-106) or not (z <= 1.12e-114): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8e-106) || !(z <= 1.12e-114)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8e-106) || ~((z <= 1.12e-114))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8e-106], N[Not[LessEqual[z, 1.12e-114]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-106} \lor \neg \left(z \leq 1.12 \cdot 10^{-114}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.99999999999999953e-106 or 1.11999999999999995e-114 < z Initial program 99.4%
Taylor expanded in z around inf 70.2%
+-commutative70.2%
Simplified70.2%
if -7.99999999999999953e-106 < z < 1.11999999999999995e-114Initial program 98.7%
Taylor expanded in x around inf 62.8%
Final simplification67.9%
(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 99.2%
Taylor expanded in x around inf 57.1%
Final simplification57.1%
(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 2023320
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))