
(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 (/ (- 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 97.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.6e+149)
(+ x y)
(if (<= z -1.75e+84)
(- x (* y (/ t z)))
(if (or (<= z -2.2e-37) (not (<= z 3.4e+24)))
(+ x y)
(+ x (* y (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+149) {
tmp = x + y;
} else if (z <= -1.75e+84) {
tmp = x - (y * (t / z));
} else if ((z <= -2.2e-37) || !(z <= 3.4e+24)) {
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 <= (-6.6d+149)) then
tmp = x + y
else if (z <= (-1.75d+84)) then
tmp = x - (y * (t / z))
else if ((z <= (-2.2d-37)) .or. (.not. (z <= 3.4d+24))) 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 <= -6.6e+149) {
tmp = x + y;
} else if (z <= -1.75e+84) {
tmp = x - (y * (t / z));
} else if ((z <= -2.2e-37) || !(z <= 3.4e+24)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.6e+149: tmp = x + y elif z <= -1.75e+84: tmp = x - (y * (t / z)) elif (z <= -2.2e-37) or not (z <= 3.4e+24): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+149) tmp = Float64(x + y); elseif (z <= -1.75e+84) tmp = Float64(x - Float64(y * Float64(t / z))); elseif ((z <= -2.2e-37) || !(z <= 3.4e+24)) 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 <= -6.6e+149) tmp = x + y; elseif (z <= -1.75e+84) tmp = x - (y * (t / z)); elseif ((z <= -2.2e-37) || ~((z <= 3.4e+24))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+149], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.75e+84], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.2e-37], N[Not[LessEqual[z, 3.4e+24]], $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 -6.6 \cdot 10^{+149}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{+84}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-37} \lor \neg \left(z \leq 3.4 \cdot 10^{+24}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -6.6e149 or -1.7499999999999999e84 < z < -2.20000000000000002e-37 or 3.4000000000000001e24 < z Initial program 99.9%
Taylor expanded in z around inf 80.3%
+-commutative80.3%
Simplified80.3%
if -6.6e149 < z < -1.7499999999999999e84Initial program 99.9%
associate-*r/79.8%
Simplified79.8%
Taylor expanded in z around 0 79.2%
mul-1-neg79.2%
distribute-lft-neg-out79.2%
*-commutative79.2%
Simplified79.2%
div-inv79.3%
*-commutative79.3%
*-commutative79.3%
add-sqr-sqrt26.4%
sqrt-unprod58.5%
sqr-neg58.5%
sqrt-unprod37.3%
add-sqr-sqrt48.8%
remove-double-neg48.8%
distribute-rgt-neg-out48.8%
cancel-sign-sub-inv48.8%
associate-*l*53.4%
div-inv53.4%
add-sqr-sqrt16.2%
sqrt-unprod49.2%
sqr-neg49.2%
sqrt-unprod52.7%
add-sqr-sqrt84.5%
Applied egg-rr84.5%
Taylor expanded in z around inf 84.5%
if -2.20000000000000002e-37 < z < 3.4000000000000001e24Initial program 95.5%
Taylor expanded in z around 0 73.2%
*-commutative73.2%
associate-/l*76.7%
Simplified76.7%
Final simplification78.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.1e+148)
(+ x y)
(if (<= z -1.2e+82)
(- x (* t (/ y z)))
(if (or (<= z -2.2e-37) (not (<= z 8.2e+24)))
(+ x y)
(+ x (* y (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.1e+148) {
tmp = x + y;
} else if (z <= -1.2e+82) {
tmp = x - (t * (y / z));
} else if ((z <= -2.2e-37) || !(z <= 8.2e+24)) {
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+148)) then
tmp = x + y
else if (z <= (-1.2d+82)) then
tmp = x - (t * (y / z))
else if ((z <= (-2.2d-37)) .or. (.not. (z <= 8.2d+24))) 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+148) {
tmp = x + y;
} else if (z <= -1.2e+82) {
tmp = x - (t * (y / z));
} else if ((z <= -2.2e-37) || !(z <= 8.2e+24)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.1e+148: tmp = x + y elif z <= -1.2e+82: tmp = x - (t * (y / z)) elif (z <= -2.2e-37) or not (z <= 8.2e+24): 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+148) tmp = Float64(x + y); elseif (z <= -1.2e+82) tmp = Float64(x - Float64(t * Float64(y / z))); elseif ((z <= -2.2e-37) || !(z <= 8.2e+24)) 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 <= -4.1e+148) tmp = x + y; elseif (z <= -1.2e+82) tmp = x - (t * (y / z)); elseif ((z <= -2.2e-37) || ~((z <= 8.2e+24))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.1e+148], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.2e+82], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.2e-37], N[Not[LessEqual[z, 8.2e+24]], $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 -4.1 \cdot 10^{+148}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{+82}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-37} \lor \neg \left(z \leq 8.2 \cdot 10^{+24}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.0999999999999998e148 or -1.19999999999999999e82 < z < -2.20000000000000002e-37 or 8.2000000000000002e24 < z Initial program 99.9%
Taylor expanded in z around inf 80.3%
+-commutative80.3%
Simplified80.3%
if -4.0999999999999998e148 < z < -1.19999999999999999e82Initial program 99.9%
associate-*r/79.8%
Simplified79.8%
Taylor expanded in z around 0 79.2%
mul-1-neg79.2%
distribute-lft-neg-out79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in z around inf 79.2%
mul-1-neg79.2%
unsub-neg79.2%
associate-/l*84.4%
Simplified84.4%
if -2.20000000000000002e-37 < z < 8.2000000000000002e24Initial program 95.5%
Taylor expanded in z around 0 73.2%
*-commutative73.2%
associate-/l*76.7%
Simplified76.7%
Final simplification78.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.6e+80)
(+ x (* y (- 1.0 (/ t z))))
(if (or (<= z -9.2e-116) (not (<= z 8e-66)))
(+ x (/ y (- 1.0 (/ a z))))
(+ x (* y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+80) {
tmp = x + (y * (1.0 - (t / z)));
} else if ((z <= -9.2e-116) || !(z <= 8e-66)) {
tmp = x + (y / (1.0 - (a / z)));
} 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 <= (-1.6d+80)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if ((z <= (-9.2d-116)) .or. (.not. (z <= 8d-66))) then
tmp = x + (y / (1.0d0 - (a / z)))
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 <= -1.6e+80) {
tmp = x + (y * (1.0 - (t / z)));
} else if ((z <= -9.2e-116) || !(z <= 8e-66)) {
tmp = x + (y / (1.0 - (a / z)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e+80: tmp = x + (y * (1.0 - (t / z))) elif (z <= -9.2e-116) or not (z <= 8e-66): tmp = x + (y / (1.0 - (a / z))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+80) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif ((z <= -9.2e-116) || !(z <= 8e-66)) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); 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 <= -1.6e+80) tmp = x + (y * (1.0 - (t / z))); elseif ((z <= -9.2e-116) || ~((z <= 8e-66))) tmp = x + (y / (1.0 - (a / z))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+80], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -9.2e-116], N[Not[LessEqual[z, 8e-66]], $MachinePrecision]], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+80}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-116} \lor \neg \left(z \leq 8 \cdot 10^{-66}\right):\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.59999999999999995e80Initial program 99.9%
Taylor expanded in a around 0 75.0%
associate-/l*93.3%
div-sub93.3%
*-inverses93.3%
Simplified93.3%
if -1.59999999999999995e80 < z < -9.20000000000000006e-116 or 7.9999999999999998e-66 < z Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 77.9%
associate-*l/82.6%
associate-/r/85.3%
div-sub85.4%
*-inverses85.4%
Simplified85.4%
if -9.20000000000000006e-116 < z < 7.9999999999999998e-66Initial program 94.0%
Taylor expanded in z around 0 79.1%
*-commutative79.1%
associate-/l*80.9%
Simplified80.9%
Final simplification85.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.9e+56)
(+ x (* y (- 1.0 (/ t z))))
(if (<= z -4.9e-116)
(+ x (/ (* y z) (- z a)))
(if (<= z 6e-63) (+ 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 <= -6.9e+56) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= -4.9e-116) {
tmp = x + ((y * z) / (z - a));
} else if (z <= 6e-63) {
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 <= (-6.9d+56)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if (z <= (-4.9d-116)) then
tmp = x + ((y * z) / (z - a))
else if (z <= 6d-63) 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 <= -6.9e+56) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= -4.9e-116) {
tmp = x + ((y * z) / (z - a));
} else if (z <= 6e-63) {
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 <= -6.9e+56: tmp = x + (y * (1.0 - (t / z))) elif z <= -4.9e-116: tmp = x + ((y * z) / (z - a)) elif z <= 6e-63: 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 <= -6.9e+56) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (z <= -4.9e-116) tmp = Float64(x + Float64(Float64(y * z) / Float64(z - a))); elseif (z <= 6e-63) 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 <= -6.9e+56) tmp = x + (y * (1.0 - (t / z))); elseif (z <= -4.9e-116) tmp = x + ((y * z) / (z - a)); elseif (z <= 6e-63) 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, -6.9e+56], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.9e-116], N[(x + N[(N[(y * z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-63], 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 -6.9 \cdot 10^{+56}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{-116}:\\
\;\;\;\;x + \frac{y \cdot z}{z - a}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-63}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -6.9e56Initial program 99.9%
Taylor expanded in a around 0 76.8%
associate-/l*92.7%
div-sub92.7%
*-inverses92.7%
Simplified92.7%
if -6.9e56 < z < -4.89999999999999977e-116Initial program 99.9%
Taylor expanded in t around 0 82.9%
if -4.89999999999999977e-116 < z < 5.99999999999999959e-63Initial program 94.0%
Taylor expanded in z around 0 79.1%
*-commutative79.1%
associate-/l*80.9%
Simplified80.9%
if 5.99999999999999959e-63 < z Initial program 99.9%
Taylor expanded in t around 0 75.3%
+-commutative75.3%
associate-/l*86.3%
Simplified86.3%
Final simplification85.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.2e+57)
(+ x (* y (- 1.0 (/ t z))))
(if (<= z -6e-115)
(+ x (/ (* y z) (- z a)))
(if (<= z 1.18e-63) (+ x (* y (/ t a))) (+ x (/ y (- 1.0 (/ a z))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+57) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= -6e-115) {
tmp = x + ((y * z) / (z - a));
} else if (z <= 1.18e-63) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.2d+57)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if (z <= (-6d-115)) then
tmp = x + ((y * z) / (z - a))
else if (z <= 1.18d-63) then
tmp = x + (y * (t / a))
else
tmp = x + (y / (1.0d0 - (a / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+57) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= -6e-115) {
tmp = x + ((y * z) / (z - a));
} else if (z <= 1.18e-63) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.2e+57: tmp = x + (y * (1.0 - (t / z))) elif z <= -6e-115: tmp = x + ((y * z) / (z - a)) elif z <= 1.18e-63: tmp = x + (y * (t / a)) else: tmp = x + (y / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.2e+57) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (z <= -6e-115) tmp = Float64(x + Float64(Float64(y * z) / Float64(z - a))); elseif (z <= 1.18e-63) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.2e+57) tmp = x + (y * (1.0 - (t / z))); elseif (z <= -6e-115) tmp = x + ((y * z) / (z - a)); elseif (z <= 1.18e-63) tmp = x + (y * (t / a)); else tmp = x + (y / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.2e+57], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6e-115], N[(x + N[(N[(y * z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.18e-63], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+57}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-115}:\\
\;\;\;\;x + \frac{y \cdot z}{z - a}\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-63}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if z < -2.2000000000000001e57Initial program 99.9%
Taylor expanded in a around 0 76.8%
associate-/l*92.7%
div-sub92.7%
*-inverses92.7%
Simplified92.7%
if -2.2000000000000001e57 < z < -6.0000000000000003e-115Initial program 99.9%
Taylor expanded in t around 0 82.9%
if -6.0000000000000003e-115 < z < 1.17999999999999999e-63Initial program 94.0%
Taylor expanded in z around 0 79.1%
*-commutative79.1%
associate-/l*80.9%
Simplified80.9%
if 1.17999999999999999e-63 < z Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 75.3%
associate-*l/83.3%
associate-/r/86.2%
div-sub86.2%
*-inverses86.2%
Simplified86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.1e+32) (not (<= t 1.6e-25))) (+ x (* t (/ y (- a z)))) (+ x (/ y (- 1.0 (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e+32) || !(t <= 1.6e-25)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.1d+32)) .or. (.not. (t <= 1.6d-25))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y / (1.0d0 - (a / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e+32) || !(t <= 1.6e-25)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.1e+32) or not (t <= 1.6e-25): tmp = x + (t * (y / (a - z))) else: tmp = x + (y / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.1e+32) || !(t <= 1.6e-25)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.1e+32) || ~((t <= 1.6e-25))) tmp = x + (t * (y / (a - z))); else tmp = x + (y / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.1e+32], N[Not[LessEqual[t, 1.6e-25]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+32} \lor \neg \left(t \leq 1.6 \cdot 10^{-25}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.09999999999999981e32 or 1.6000000000000001e-25 < t Initial program 96.0%
Taylor expanded in t around inf 79.4%
mul-1-neg79.4%
associate-/l*90.1%
Simplified90.1%
if -4.09999999999999981e32 < t < 1.6000000000000001e-25Initial program 99.2%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in t around 0 84.8%
associate-*l/87.4%
associate-/r/92.9%
div-sub92.9%
*-inverses92.9%
Simplified92.9%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.7e+32) (not (<= t 7e-26))) (- x (* y (/ t (- z a)))) (+ x (/ y (- 1.0 (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.7e+32) || !(t <= 7e-26)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.7d+32)) .or. (.not. (t <= 7d-26))) then
tmp = x - (y * (t / (z - a)))
else
tmp = x + (y / (1.0d0 - (a / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.7e+32) || !(t <= 7e-26)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.7e+32) or not (t <= 7e-26): tmp = x - (y * (t / (z - a))) else: tmp = x + (y / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.7e+32) || !(t <= 7e-26)) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.7e+32) || ~((t <= 7e-26))) tmp = x - (y * (t / (z - a))); else tmp = x + (y / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.7e+32], N[Not[LessEqual[t, 7e-26]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+32} \lor \neg \left(t \leq 7 \cdot 10^{-26}\right):\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.69999999999999989e32 or 6.9999999999999997e-26 < t Initial program 96.0%
associate-*r/84.9%
Simplified84.9%
Taylor expanded in z around 0 79.4%
mul-1-neg79.4%
distribute-lft-neg-out79.4%
*-commutative79.4%
Simplified79.4%
div-inv79.4%
*-commutative79.4%
*-commutative79.4%
add-sqr-sqrt35.8%
sqrt-unprod36.1%
sqr-neg36.1%
sqrt-unprod17.9%
add-sqr-sqrt30.5%
remove-double-neg30.5%
distribute-rgt-neg-out30.5%
cancel-sign-sub-inv30.5%
associate-*l*35.4%
div-inv35.4%
add-sqr-sqrt15.9%
sqrt-unprod44.4%
sqr-neg44.4%
sqrt-unprod47.1%
add-sqr-sqrt87.1%
Applied egg-rr87.1%
if -1.69999999999999989e32 < t < 6.9999999999999997e-26Initial program 99.2%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in t around 0 84.8%
associate-*l/87.4%
associate-/r/92.9%
div-sub92.9%
*-inverses92.9%
Simplified92.9%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3e-60) (not (<= z 2.9e-56))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3e-60) || !(z <= 2.9e-56)) {
tmp = x + (y * (1.0 - (t / z)));
} 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 <= (-3d-60)) .or. (.not. (z <= 2.9d-56))) then
tmp = x + (y * (1.0d0 - (t / z)))
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 <= -3e-60) || !(z <= 2.9e-56)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3e-60) or not (z <= 2.9e-56): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3e-60) || !(z <= 2.9e-56)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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 <= -3e-60) || ~((z <= 2.9e-56))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3e-60], N[Not[LessEqual[z, 2.9e-56]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-60} \lor \neg \left(z \leq 2.9 \cdot 10^{-56}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.00000000000000019e-60 or 2.89999999999999991e-56 < z Initial program 99.9%
Taylor expanded in a around 0 73.5%
associate-/l*84.9%
div-sub84.9%
*-inverses84.9%
Simplified84.9%
if -3.00000000000000019e-60 < z < 2.89999999999999991e-56Initial program 94.6%
Taylor expanded in z around 0 77.6%
*-commutative77.6%
associate-/l*80.1%
Simplified80.1%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.3e-37) (not (<= z 1.4e+27))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.3e-37) || !(z <= 1.4e+27)) {
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 <= (-2.3d-37)) .or. (.not. (z <= 1.4d+27))) 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 <= -2.3e-37) || !(z <= 1.4e+27)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.3e-37) or not (z <= 1.4e+27): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.3e-37) || !(z <= 1.4e+27)) 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 <= -2.3e-37) || ~((z <= 1.4e+27))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.3e-37], N[Not[LessEqual[z, 1.4e+27]], $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 -2.3 \cdot 10^{-37} \lor \neg \left(z \leq 1.4 \cdot 10^{+27}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.3e-37 or 1.4e27 < z Initial program 99.9%
Taylor expanded in z around inf 77.2%
+-commutative77.2%
Simplified77.2%
if -2.3e-37 < z < 1.4e27Initial program 95.5%
Taylor expanded in z around 0 73.2%
*-commutative73.2%
associate-/l*76.7%
Simplified76.7%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (<= a 3.1e+137) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 3.1e+137) {
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 (a <= 3.1d+137) 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 (a <= 3.1e+137) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 3.1e+137: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 3.1e+137) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 3.1e+137) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 3.1e+137], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.1 \cdot 10^{+137}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 3.0999999999999999e137Initial program 97.7%
Taylor expanded in z around inf 62.4%
+-commutative62.4%
Simplified62.4%
if 3.0999999999999999e137 < a Initial program 97.6%
Taylor expanded in x around inf 62.6%
Final simplification62.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 97.7%
Taylor expanded in x around inf 50.2%
(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 2024089
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))