
(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 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(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 (/ (- 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}
Initial program 98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.2e+33)
(+ x y)
(if (<= z 2.3e-78)
(+ x (* y (/ t a)))
(if (<= z 6.2e+75) (- x (* y (/ t z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+33) {
tmp = x + y;
} else if (z <= 2.3e-78) {
tmp = x + (y * (t / a));
} else if (z <= 6.2e+75) {
tmp = x - (y * (t / z));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.2d+33)) then
tmp = x + y
else if (z <= 2.3d-78) then
tmp = x + (y * (t / a))
else if (z <= 6.2d+75) then
tmp = x - (y * (t / z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+33) {
tmp = x + y;
} else if (z <= 2.3e-78) {
tmp = x + (y * (t / a));
} else if (z <= 6.2e+75) {
tmp = x - (y * (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.2e+33: tmp = x + y elif z <= 2.3e-78: tmp = x + (y * (t / a)) elif z <= 6.2e+75: tmp = x - (y * (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.2e+33) tmp = Float64(x + y); elseif (z <= 2.3e-78) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 6.2e+75) tmp = Float64(x - Float64(y * Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.2e+33) tmp = x + y; elseif (z <= 2.3e-78) tmp = x + (y * (t / a)); elseif (z <= 6.2e+75) tmp = x - (y * (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.2e+33], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.3e-78], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+75], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+33}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-78}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+75}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.19999999999999994e33 or 6.2000000000000002e75 < z Initial program 99.9%
Taylor expanded in z around inf 77.6%
if -2.19999999999999994e33 < z < 2.3000000000000002e-78Initial program 95.7%
Taylor expanded in z around 0 80.5%
if 2.3000000000000002e-78 < z < 6.2000000000000002e75Initial program 99.9%
Taylor expanded in a around 0 80.5%
Taylor expanded in z around 0 78.7%
mul-1-neg78.7%
distribute-lft-neg-out78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in x around 0 78.7%
mul-1-neg78.7%
*-commutative78.7%
sub-neg78.7%
associate-*r/78.8%
Simplified78.8%
Final simplification79.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.05e+29)
(+ x y)
(if (<= z 4e-78)
(+ x (* y (/ t a)))
(if (<= z 5.5e+75) (- x (* t (/ y z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+29) {
tmp = x + y;
} else if (z <= 4e-78) {
tmp = x + (y * (t / a));
} else if (z <= 5.5e+75) {
tmp = x - (t * (y / z));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.05d+29)) then
tmp = x + y
else if (z <= 4d-78) then
tmp = x + (y * (t / a))
else if (z <= 5.5d+75) then
tmp = x - (t * (y / z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+29) {
tmp = x + y;
} else if (z <= 4e-78) {
tmp = x + (y * (t / a));
} else if (z <= 5.5e+75) {
tmp = x - (t * (y / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+29: tmp = x + y elif z <= 4e-78: tmp = x + (y * (t / a)) elif z <= 5.5e+75: tmp = x - (t * (y / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+29) tmp = Float64(x + y); elseif (z <= 4e-78) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 5.5e+75) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e+29) tmp = x + y; elseif (z <= 4e-78) tmp = x + (y * (t / a)); elseif (z <= 5.5e+75) tmp = x - (t * (y / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+29], N[(x + y), $MachinePrecision], If[LessEqual[z, 4e-78], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e+75], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+29}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-78}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+75}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.0500000000000001e29 or 5.5000000000000001e75 < z Initial program 99.9%
Taylor expanded in z around inf 77.6%
if -1.0500000000000001e29 < z < 4e-78Initial program 95.7%
Taylor expanded in z around 0 80.5%
if 4e-78 < z < 5.5000000000000001e75Initial program 99.9%
Taylor expanded in a around 0 80.5%
associate-/l*80.6%
Simplified80.6%
Taylor expanded in z around 0 78.7%
associate-*r/78.8%
neg-mul-178.8%
distribute-rgt-neg-in78.8%
Simplified78.8%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.175) (not (<= z 8e-156))) (+ x (* y (/ z (- z a)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.175) || !(z <= 8e-156)) {
tmp = x + (y * (z / (z - a)));
} 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 <= (-0.175d0)) .or. (.not. (z <= 8d-156))) then
tmp = x + (y * (z / (z - a)))
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 <= -0.175) || !(z <= 8e-156)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.175) or not (z <= 8e-156): tmp = x + (y * (z / (z - a))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.175) || !(z <= 8e-156)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); 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 <= -0.175) || ~((z <= 8e-156))) tmp = x + (y * (z / (z - a))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.175], N[Not[LessEqual[z, 8e-156]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.175 \lor \neg \left(z \leq 8 \cdot 10^{-156}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -0.17499999999999999 or 8.00000000000000032e-156 < z Initial program 99.4%
Taylor expanded in t around 0 83.9%
if -0.17499999999999999 < z < 8.00000000000000032e-156Initial program 95.6%
Taylor expanded in z around 0 82.9%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.55e+61) (not (<= a 8e+55))) (- x (/ y (/ a (- z t)))) (+ x (/ y (/ z (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.55e+61) || !(a <= 8e+55)) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + (y / (z / (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 ((a <= (-3.55d+61)) .or. (.not. (a <= 8d+55))) then
tmp = x - (y / (a / (z - t)))
else
tmp = x + (y / (z / (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 ((a <= -3.55e+61) || !(a <= 8e+55)) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.55e+61) or not (a <= 8e+55): tmp = x - (y / (a / (z - t))) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.55e+61) || !(a <= 8e+55)) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.55e+61) || ~((a <= 8e+55))) tmp = x - (y / (a / (z - t))); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.55e+61], N[Not[LessEqual[a, 8e+55]], $MachinePrecision]], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.55 \cdot 10^{+61} \lor \neg \left(a \leq 8 \cdot 10^{+55}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if a < -3.55e61 or 8.00000000000000008e55 < a Initial program 98.1%
Taylor expanded in a around inf 81.7%
mul-1-neg81.7%
associate-/l*87.9%
Simplified87.9%
if -3.55e61 < a < 8.00000000000000008e55Initial program 98.0%
Taylor expanded in a around 0 68.1%
associate-/l*82.6%
Simplified82.6%
Final simplification84.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.47) (not (<= z 7.6e+74))) (+ x (* y (/ z (- z a)))) (- x (/ (* y t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.47) || !(z <= 7.6e+74)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - ((y * t) / (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.47d0)) .or. (.not. (z <= 7.6d+74))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x - ((y * t) / (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.47) || !(z <= 7.6e+74)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - ((y * t) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.47) or not (z <= 7.6e+74): tmp = x + (y * (z / (z - a))) else: tmp = x - ((y * t) / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.47) || !(z <= 7.6e+74)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(Float64(y * t) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -0.47) || ~((z <= 7.6e+74))) tmp = x + (y * (z / (z - a))); else tmp = x - ((y * t) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.47], N[Not[LessEqual[z, 7.6e+74]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.47 \lor \neg \left(z \leq 7.6 \cdot 10^{+74}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot t}{z - a}\\
\end{array}
\end{array}
if z < -0.46999999999999997 or 7.5999999999999997e74 < z Initial program 100.0%
Taylor expanded in t around 0 87.1%
if -0.46999999999999997 < z < 7.5999999999999997e74Initial program 96.2%
Taylor expanded in t around inf 87.6%
associate-*r/87.6%
mul-1-neg87.6%
distribute-lft-neg-out87.6%
*-commutative87.6%
Simplified87.6%
Final simplification87.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -0.13) (+ x (* y (/ z (- z a)))) (if (<= z 3.8e-78) (+ x (* y (/ t a))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.13) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 3.8e-78) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y * ((z - 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 <= (-0.13d0)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 3.8d-78) then
tmp = x + (y * (t / a))
else
tmp = x + (y * ((z - 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 <= -0.13) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 3.8e-78) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -0.13: tmp = x + (y * (z / (z - a))) elif z <= 3.8e-78: tmp = x + (y * (t / a)) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.13) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 3.8e-78) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -0.13) tmp = x + (y * (z / (z - a))); elseif (z <= 3.8e-78) tmp = x + (y * (t / a)); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.13], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-78], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.13:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-78}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -0.13Initial program 99.9%
Taylor expanded in t around 0 83.3%
if -0.13 < z < 3.7999999999999999e-78Initial program 95.3%
Taylor expanded in z around 0 82.3%
if 3.7999999999999999e-78 < z Initial program 100.0%
Taylor expanded in a around 0 86.7%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.05e+35) (not (<= z 9e+74))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.05e+35) || !(z <= 9e+74)) {
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 <= (-1.05d+35)) .or. (.not. (z <= 9d+74))) 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 <= -1.05e+35) || !(z <= 9e+74)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.05e+35) or not (z <= 9e+74): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.05e+35) || !(z <= 9e+74)) 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 <= -1.05e+35) || ~((z <= 9e+74))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.05e+35], N[Not[LessEqual[z, 9e+74]], $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 -1.05 \cdot 10^{+35} \lor \neg \left(z \leq 9 \cdot 10^{+74}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.0499999999999999e35 or 8.9999999999999999e74 < z Initial program 99.9%
Taylor expanded in z around inf 77.6%
if -1.0499999999999999e35 < z < 8.9999999999999999e74Initial program 96.5%
associate-*r/94.5%
*-commutative94.5%
associate-/l*97.0%
Applied egg-rr97.0%
Taylor expanded in z around 0 72.9%
associate-*r/74.5%
Simplified74.5%
Final simplification75.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.2e+33) (not (<= z 3.9e+76))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e+33) || !(z <= 3.9e+76)) {
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 <= (-9.2d+33)) .or. (.not. (z <= 3.9d+76))) 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 <= -9.2e+33) || !(z <= 3.9e+76)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e+33) or not (z <= 3.9e+76): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e+33) || !(z <= 3.9e+76)) 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 <= -9.2e+33) || ~((z <= 3.9e+76))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.2e+33], N[Not[LessEqual[z, 3.9e+76]], $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 -9.2 \cdot 10^{+33} \lor \neg \left(z \leq 3.9 \cdot 10^{+76}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -9.20000000000000042e33 or 3.89999999999999989e76 < z Initial program 99.9%
Taylor expanded in z around inf 77.6%
if -9.20000000000000042e33 < z < 3.89999999999999989e76Initial program 96.5%
Taylor expanded in z around 0 77.0%
Final simplification77.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e-104) (not (<= z 1.02e+15))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e-104) || !(z <= 1.02e+15)) {
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 <= (-5.5d-104)) .or. (.not. (z <= 1.02d+15))) 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 <= -5.5e-104) || !(z <= 1.02e+15)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.5e-104) or not (z <= 1.02e+15): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e-104) || !(z <= 1.02e+15)) 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 <= -5.5e-104) || ~((z <= 1.02e+15))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e-104], N[Not[LessEqual[z, 1.02e+15]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-104} \lor \neg \left(z \leq 1.02 \cdot 10^{+15}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.4999999999999998e-104 or 1.02e15 < z Initial program 99.9%
Taylor expanded in z around inf 71.8%
if -5.4999999999999998e-104 < z < 1.02e15Initial program 95.2%
Taylor expanded in a around 0 45.1%
associate-/l*42.7%
Simplified42.7%
Taylor expanded in x around inf 54.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.1%
Taylor expanded in a around 0 55.3%
associate-/l*67.0%
Simplified67.0%
Taylor expanded in x around inf 47.6%
Final simplification47.6%
(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 2023333
(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)))))