
(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 13 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 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 98.1%
clear-num98.0%
un-div-inv98.5%
Applied egg-rr98.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.5e+68) (not (<= z 7e+36))) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e+68) || !(z <= 7e+36)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / (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 <= (-8.5d+68)) .or. (.not. (z <= 7d+36))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (y * (t / (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 <= -8.5e+68) || !(z <= 7e+36)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.5e+68) or not (z <= 7e+36): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.5e+68) || !(z <= 7e+36)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.5e+68) || ~((z <= 7e+36))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.5e+68], N[Not[LessEqual[z, 7e+36]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+68} \lor \neg \left(z \leq 7 \cdot 10^{+36}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -8.49999999999999966e68 or 6.9999999999999996e36 < z Initial program 99.9%
Taylor expanded in a around 0 85.8%
if -8.49999999999999966e68 < z < 6.9999999999999996e36Initial program 96.7%
Taylor expanded in t around inf 89.4%
associate-*r/89.4%
mul-1-neg89.4%
distribute-lft-neg-out89.4%
*-commutative89.4%
*-lft-identity89.4%
times-frac90.0%
/-rgt-identity90.0%
distribute-neg-frac90.0%
distribute-neg-frac290.0%
neg-sub090.0%
sub-neg90.0%
+-commutative90.0%
associate--r+90.0%
neg-sub090.0%
remove-double-neg90.0%
Simplified90.0%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.5e+92) (not (<= z 1.6e+86))) (+ x y) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e+92) || !(z <= 1.6e+86)) {
tmp = x + y;
} else {
tmp = x + (y * (t / (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 <= (-8.5d+92)) .or. (.not. (z <= 1.6d+86))) then
tmp = x + y
else
tmp = x + (y * (t / (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 <= -8.5e+92) || !(z <= 1.6e+86)) {
tmp = x + y;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.5e+92) or not (z <= 1.6e+86): tmp = x + y else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.5e+92) || !(z <= 1.6e+86)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.5e+92) || ~((z <= 1.6e+86))) tmp = x + y; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.5e+92], N[Not[LessEqual[z, 1.6e+86]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+92} \lor \neg \left(z \leq 1.6 \cdot 10^{+86}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -8.5000000000000001e92 or 1.6e86 < z Initial program 99.9%
Taylor expanded in z around inf 83.9%
+-commutative83.9%
Simplified83.9%
if -8.5000000000000001e92 < z < 1.6e86Initial program 97.1%
Taylor expanded in t around inf 86.3%
associate-*r/86.3%
mul-1-neg86.3%
distribute-lft-neg-out86.3%
*-commutative86.3%
*-lft-identity86.3%
times-frac88.5%
/-rgt-identity88.5%
distribute-neg-frac88.5%
distribute-neg-frac288.5%
neg-sub088.5%
sub-neg88.5%
+-commutative88.5%
associate--r+88.5%
neg-sub088.5%
remove-double-neg88.5%
Simplified88.5%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.5e+79) (+ x (* t (/ y (- a z)))) (if (<= t 1.48e-12) (+ x (* y (/ z (- z a)))) (+ x (* y (/ t (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.5e+79) {
tmp = x + (t * (y / (a - z)));
} else if (t <= 1.48e-12) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / (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 <= (-7.5d+79)) then
tmp = x + (t * (y / (a - z)))
else if (t <= 1.48d-12) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y * (t / (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 <= -7.5e+79) {
tmp = x + (t * (y / (a - z)));
} else if (t <= 1.48e-12) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.5e+79: tmp = x + (t * (y / (a - z))) elif t <= 1.48e-12: tmp = x + (y * (z / (z - a))) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.5e+79) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); elseif (t <= 1.48e-12) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.5e+79) tmp = x + (t * (y / (a - z))); elseif (t <= 1.48e-12) tmp = x + (y * (z / (z - a))); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.5e+79], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.48e-12], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+79}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;t \leq 1.48 \cdot 10^{-12}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if t < -7.49999999999999967e79Initial program 90.4%
Taylor expanded in t around inf 80.1%
mul-1-neg80.1%
associate-/l*90.5%
Simplified90.5%
if -7.49999999999999967e79 < t < 1.47999999999999995e-12Initial program 99.9%
Taylor expanded in t around 0 76.1%
+-commutative76.1%
associate-/l*91.9%
Simplified91.9%
if 1.47999999999999995e-12 < t Initial program 99.8%
Taylor expanded in t around inf 85.0%
associate-*r/85.0%
mul-1-neg85.0%
distribute-lft-neg-out85.0%
*-commutative85.0%
*-lft-identity85.0%
times-frac92.1%
/-rgt-identity92.1%
distribute-neg-frac92.1%
distribute-neg-frac292.1%
neg-sub092.1%
sub-neg92.1%
+-commutative92.1%
associate--r+92.1%
neg-sub092.1%
remove-double-neg92.1%
Simplified92.1%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.76e+93) (+ x (* y (/ z (- z a)))) (if (<= z 1.04e+40) (+ x (* y (/ t (- a z)))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.76e+93) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 1.04e+40) {
tmp = x + (y * (t / (a - z)));
} 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 (z <= (-1.76d+93)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 1.04d+40) then
tmp = x + (y * (t / (a - z)))
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 (z <= -1.76e+93) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 1.04e+40) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.76e+93: tmp = x + (y * (z / (z - a))) elif z <= 1.04e+40: tmp = x + (y * (t / (a - z))) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.76e+93) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 1.04e+40) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); 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 (z <= -1.76e+93) tmp = x + (y * (z / (z - a))); elseif (z <= 1.04e+40) tmp = x + (y * (t / (a - z))); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.76e+93], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.04e+40], N[(x + N[(y * N[(t / N[(a - z), $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}\;z \leq -1.76 \cdot 10^{+93}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 1.04 \cdot 10^{+40}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -1.75999999999999994e93Initial program 99.9%
Taylor expanded in t around 0 61.8%
+-commutative61.8%
associate-/l*95.9%
Simplified95.9%
if -1.75999999999999994e93 < z < 1.04e40Initial program 96.8%
Taylor expanded in t around inf 87.4%
associate-*r/87.4%
mul-1-neg87.4%
distribute-lft-neg-out87.4%
*-commutative87.4%
*-lft-identity87.4%
times-frac89.2%
/-rgt-identity89.2%
distribute-neg-frac89.2%
distribute-neg-frac289.2%
neg-sub089.2%
sub-neg89.2%
+-commutative89.2%
associate--r+89.2%
neg-sub089.2%
remove-double-neg89.2%
Simplified89.2%
if 1.04e40 < z Initial program 99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 90.7%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.7e+92) (+ x (* z (/ y (- z a)))) (if (<= z 3.2e+27) (+ x (* y (/ t (- a z)))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.7e+92) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 3.2e+27) {
tmp = x + (y * (t / (a - z)));
} 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 (z <= (-4.7d+92)) then
tmp = x + (z * (y / (z - a)))
else if (z <= 3.2d+27) then
tmp = x + (y * (t / (a - z)))
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 (z <= -4.7e+92) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 3.2e+27) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.7e+92: tmp = x + (z * (y / (z - a))) elif z <= 3.2e+27: tmp = x + (y * (t / (a - z))) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.7e+92) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); elseif (z <= 3.2e+27) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); 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 (z <= -4.7e+92) tmp = x + (z * (y / (z - a))); elseif (z <= 3.2e+27) tmp = x + (y * (t / (a - z))); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.7e+92], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+27], N[(x + N[(y * N[(t / N[(a - z), $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}\;z \leq -4.7 \cdot 10^{+92}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+27}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -4.7e92Initial program 99.9%
associate-*r/64.0%
Simplified64.0%
*-commutative64.0%
associate-/l*98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 94.0%
if -4.7e92 < z < 3.20000000000000015e27Initial program 96.8%
Taylor expanded in t around inf 87.4%
associate-*r/87.4%
mul-1-neg87.4%
distribute-lft-neg-out87.4%
*-commutative87.4%
*-lft-identity87.4%
times-frac89.2%
/-rgt-identity89.2%
distribute-neg-frac89.2%
distribute-neg-frac289.2%
neg-sub089.2%
sub-neg89.2%
+-commutative89.2%
associate--r+89.2%
neg-sub089.2%
remove-double-neg89.2%
Simplified89.2%
if 3.20000000000000015e27 < z Initial program 99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 90.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.6e+94) (+ x (* z (/ y (- z a)))) (if (<= z 2.25e+21) (+ x (* y (/ t (- a z)))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+94) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 2.25e+21) {
tmp = x + (y * (t / (a - z)));
} 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 <= (-8.6d+94)) then
tmp = x + (z * (y / (z - a)))
else if (z <= 2.25d+21) then
tmp = x + (y * (t / (a - z)))
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 <= -8.6e+94) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 2.25e+21) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.6e+94: tmp = x + (z * (y / (z - a))) elif z <= 2.25e+21: tmp = x + (y * (t / (a - z))) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.6e+94) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); elseif (z <= 2.25e+21) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); 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 <= -8.6e+94) tmp = x + (z * (y / (z - a))); elseif (z <= 2.25e+21) tmp = x + (y * (t / (a - z))); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.6e+94], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+21], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $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 -8.6 \cdot 10^{+94}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+21}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -8.6e94Initial program 99.9%
associate-*r/64.0%
Simplified64.0%
*-commutative64.0%
associate-/l*98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 94.0%
if -8.6e94 < z < 2.25e21Initial program 96.8%
Taylor expanded in t around inf 87.4%
associate-*r/87.4%
mul-1-neg87.4%
distribute-lft-neg-out87.4%
*-commutative87.4%
*-lft-identity87.4%
times-frac89.2%
/-rgt-identity89.2%
distribute-neg-frac89.2%
distribute-neg-frac289.2%
neg-sub089.2%
sub-neg89.2%
+-commutative89.2%
associate--r+89.2%
neg-sub089.2%
remove-double-neg89.2%
Simplified89.2%
if 2.25e21 < z Initial program 99.9%
Taylor expanded in a around 0 90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e-57) (not (<= z 5.8e+76))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-57) || !(z <= 5.8e+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 <= (-1.35d-57)) .or. (.not. (z <= 5.8d+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 <= -1.35e-57) || !(z <= 5.8e+76)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e-57) or not (z <= 5.8e+76): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e-57) || !(z <= 5.8e+76)) 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 <= -1.35e-57) || ~((z <= 5.8e+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, -1.35e-57], N[Not[LessEqual[z, 5.8e+76]], $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 -1.35 \cdot 10^{-57} \lor \neg \left(z \leq 5.8 \cdot 10^{+76}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.3500000000000001e-57 or 5.8000000000000003e76 < z Initial program 99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -1.3500000000000001e-57 < z < 5.8000000000000003e76Initial program 96.1%
Taylor expanded in z around 0 83.0%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e-57) (not (<= z 2.85e+76))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-57) || !(z <= 2.85e+76)) {
tmp = x + y;
} 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 <= (-1.35d-57)) .or. (.not. (z <= 2.85d+76))) then
tmp = x + y
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 <= -1.35e-57) || !(z <= 2.85e+76)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e-57) or not (z <= 2.85e+76): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e-57) || !(z <= 2.85e+76)) tmp = Float64(x + y); 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 <= -1.35e-57) || ~((z <= 2.85e+76))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e-57], N[Not[LessEqual[z, 2.85e+76]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-57} \lor \neg \left(z \leq 2.85 \cdot 10^{+76}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.3500000000000001e-57 or 2.85000000000000002e76 < z Initial program 99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -1.3500000000000001e-57 < z < 2.85000000000000002e76Initial program 96.1%
clear-num96.0%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in z around 0 81.4%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.18e-57) (not (<= z 2.15e+76))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.18e-57) || !(z <= 2.15e+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 <= (-1.18d-57)) .or. (.not. (z <= 2.15d+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 <= -1.18e-57) || !(z <= 2.15e+76)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.18e-57) or not (z <= 2.15e+76): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.18e-57) || !(z <= 2.15e+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 <= -1.18e-57) || ~((z <= 2.15e+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, -1.18e-57], N[Not[LessEqual[z, 2.15e+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 -1.18 \cdot 10^{-57} \lor \neg \left(z \leq 2.15 \cdot 10^{+76}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.18e-57 or 2.14999999999999989e76 < z Initial program 99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -1.18e-57 < z < 2.14999999999999989e76Initial program 96.1%
Taylor expanded in z around 0 80.7%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e-57) (not (<= z 1.42e+76))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-57) || !(z <= 1.42e+76)) {
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 <= (-1d-57)) .or. (.not. (z <= 1.42d+76))) 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 <= -1e-57) || !(z <= 1.42e+76)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e-57) or not (z <= 1.42e+76): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e-57) || !(z <= 1.42e+76)) 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 <= -1e-57) || ~((z <= 1.42e+76))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e-57], N[Not[LessEqual[z, 1.42e+76]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-57} \lor \neg \left(z \leq 1.42 \cdot 10^{+76}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.99999999999999955e-58 or 1.41999999999999996e76 < z Initial program 99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -9.99999999999999955e-58 < z < 1.41999999999999996e76Initial program 96.1%
Taylor expanded in x around inf 55.2%
Final simplification66.7%
(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%
(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 x around inf 55.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 2024132
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))