
(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 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 98.4%
+-commutative98.4%
fma-define98.4%
Simplified98.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.16e+97)
(+ x (/ y (/ (- z a) z)))
(if (<= a -1.9e-24)
(+ x (* t (/ y a)))
(if (<= a 6.6e-71) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.16e+97) {
tmp = x + (y / ((z - a) / z));
} else if (a <= -1.9e-24) {
tmp = x + (t * (y / a));
} else if (a <= 6.6e-71) {
tmp = x + (y * ((z - 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 (a <= (-1.16d+97)) then
tmp = x + (y / ((z - a) / z))
else if (a <= (-1.9d-24)) then
tmp = x + (t * (y / a))
else if (a <= 6.6d-71) then
tmp = x + (y * ((z - 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 (a <= -1.16e+97) {
tmp = x + (y / ((z - a) / z));
} else if (a <= -1.9e-24) {
tmp = x + (t * (y / a));
} else if (a <= 6.6e-71) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.16e+97: tmp = x + (y / ((z - a) / z)) elif a <= -1.9e-24: tmp = x + (t * (y / a)) elif a <= 6.6e-71: tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.16e+97) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (a <= -1.9e-24) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (a <= 6.6e-71) tmp = Float64(x + Float64(y * Float64(Float64(z - 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 (a <= -1.16e+97) tmp = x + (y / ((z - a) / z)); elseif (a <= -1.9e-24) tmp = x + (t * (y / a)); elseif (a <= 6.6e-71) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.16e+97], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.9e-24], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.6e-71], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.16 \cdot 10^{+97}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-24}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 6.6 \cdot 10^{-71}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -1.15999999999999991e97Initial program 99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 94.1%
if -1.15999999999999991e97 < a < -1.90000000000000013e-24Initial program 99.9%
Taylor expanded in z around 0 86.7%
+-commutative86.7%
associate-/l*86.8%
Simplified86.8%
if -1.90000000000000013e-24 < a < 6.6000000000000003e-71Initial program 96.6%
Taylor expanded in a around 0 89.3%
if 6.6000000000000003e-71 < a Initial program 99.9%
Taylor expanded in z around 0 67.5%
*-commutative67.5%
associate-/l*76.9%
Simplified76.9%
Final simplification86.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.4e+97)
(- x (* y (/ z a)))
(if (<= a -5.4e-28)
(+ x (* t (/ y a)))
(if (<= a 1.3e-69) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.4e+97) {
tmp = x - (y * (z / a));
} else if (a <= -5.4e-28) {
tmp = x + (t * (y / a));
} else if (a <= 1.3e-69) {
tmp = x + (y * ((z - 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 (a <= (-1.4d+97)) then
tmp = x - (y * (z / a))
else if (a <= (-5.4d-28)) then
tmp = x + (t * (y / a))
else if (a <= 1.3d-69) then
tmp = x + (y * ((z - 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 (a <= -1.4e+97) {
tmp = x - (y * (z / a));
} else if (a <= -5.4e-28) {
tmp = x + (t * (y / a));
} else if (a <= 1.3e-69) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.4e+97: tmp = x - (y * (z / a)) elif a <= -5.4e-28: tmp = x + (t * (y / a)) elif a <= 1.3e-69: tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.4e+97) tmp = Float64(x - Float64(y * Float64(z / a))); elseif (a <= -5.4e-28) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (a <= 1.3e-69) tmp = Float64(x + Float64(y * Float64(Float64(z - 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 (a <= -1.4e+97) tmp = x - (y * (z / a)); elseif (a <= -5.4e-28) tmp = x + (t * (y / a)); elseif (a <= 1.3e-69) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.4e+97], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5.4e-28], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.3e-69], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+97}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq -5.4 \cdot 10^{-28}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-69}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -1.4e97Initial program 99.9%
Taylor expanded in a around inf 81.9%
mul-1-neg81.9%
unsub-neg81.9%
*-commutative81.9%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in z around inf 83.0%
associate-/l*87.2%
Simplified87.2%
if -1.4e97 < a < -5.3999999999999998e-28Initial program 99.9%
Taylor expanded in z around 0 86.7%
+-commutative86.7%
associate-/l*86.8%
Simplified86.8%
if -5.3999999999999998e-28 < a < 1.3000000000000001e-69Initial program 96.6%
Taylor expanded in a around 0 89.3%
if 1.3000000000000001e-69 < a Initial program 99.9%
Taylor expanded in z around 0 67.5%
*-commutative67.5%
associate-/l*76.9%
Simplified76.9%
Final simplification85.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.1e+34) (not (<= t 4.3e+89))) (+ x (* t (/ y (- a z)))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.1e+34) || !(t <= 4.3e+89)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - 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 <= (-2.1d+34)) .or. (.not. (t <= 4.3d+89))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y / ((z - 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 <= -2.1e+34) || !(t <= 4.3e+89)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.1e+34) or not (t <= 4.3e+89): tmp = x + (t * (y / (a - z))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.1e+34) || !(t <= 4.3e+89)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.1e+34) || ~((t <= 4.3e+89))) tmp = x + (t * (y / (a - z))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.1e+34], N[Not[LessEqual[t, 4.3e+89]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+34} \lor \neg \left(t \leq 4.3 \cdot 10^{+89}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -2.10000000000000017e34 or 4.3000000000000002e89 < t Initial program 95.9%
Taylor expanded in t around inf 76.4%
associate-*r/76.4%
mul-1-neg76.4%
distribute-lft-neg-out76.4%
*-commutative76.4%
associate-/l*87.1%
distribute-neg-frac87.1%
distribute-neg-frac287.1%
sub-neg87.1%
distribute-neg-in87.1%
remove-double-neg87.1%
Simplified87.1%
Taylor expanded in x around 0 76.4%
+-commutative76.4%
associate-/l*89.3%
Simplified89.3%
if -2.10000000000000017e34 < t < 4.3000000000000002e89Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 89.8%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.76e+40) (+ x (/ y (/ z (- z t)))) (if (<= z 4.3e-60) (+ x (* y (/ t (- a z)))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.76e+40) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 4.3e-60) {
tmp = x + (y * (t / (a - z)));
} 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.76d+40)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 4.3d-60) then
tmp = x + (y * (t / (a - z)))
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.76e+40) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 4.3e-60) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.76e+40: tmp = x + (y / (z / (z - t))) elif z <= 4.3e-60: tmp = x + (y * (t / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.76e+40) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 4.3e-60) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); 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.76e+40) tmp = x + (y / (z / (z - t))); elseif (z <= 4.3e-60) tmp = x + (y * (t / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.76e+40], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e-60], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $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.76 \cdot 10^{+40}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-60}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -1.7600000000000001e40Initial program 99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 88.7%
if -1.7600000000000001e40 < z < 4.3000000000000001e-60Initial program 96.9%
Taylor expanded in t around inf 90.5%
associate-*r/90.5%
mul-1-neg90.5%
distribute-lft-neg-out90.5%
*-commutative90.5%
associate-/l*91.9%
distribute-neg-frac91.9%
distribute-neg-frac291.9%
sub-neg91.9%
distribute-neg-in91.9%
remove-double-neg91.9%
Simplified91.9%
Taylor expanded in x around 0 90.5%
+-commutative90.5%
associate-/l*89.7%
Simplified89.7%
clear-num89.0%
un-div-inv90.2%
Applied egg-rr90.2%
associate-/r/91.9%
Simplified91.9%
if 4.3000000000000001e-60 < z Initial program 100.0%
Taylor expanded in t around 0 69.1%
+-commutative69.1%
associate-/l*87.4%
Simplified87.4%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.2e+40) (+ x (/ y (/ z (- z t)))) (if (<= z 4.9e-60) (+ x (/ (* y t) (- a z))) (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e+40) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 4.9e-60) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (y / ((z - 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 <= (-3.2d+40)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 4.9d-60) then
tmp = x + ((y * t) / (a - z))
else
tmp = x + (y / ((z - 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 <= -3.2e+40) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 4.9e-60) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.2e+40: tmp = x + (y / (z / (z - t))) elif z <= 4.9e-60: tmp = x + ((y * t) / (a - z)) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e+40) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 4.9e-60) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.2e+40) tmp = x + (y / (z / (z - t))); elseif (z <= 4.9e-60) tmp = x + ((y * t) / (a - z)); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e+40], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.9e-60], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+40}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-60}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -3.19999999999999981e40Initial program 99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 88.7%
if -3.19999999999999981e40 < z < 4.89999999999999988e-60Initial program 96.9%
Taylor expanded in t around inf 90.5%
associate-*r/90.5%
mul-1-neg90.5%
distribute-lft-neg-out90.5%
*-commutative90.5%
associate-/l*91.9%
distribute-neg-frac91.9%
distribute-neg-frac291.9%
sub-neg91.9%
distribute-neg-in91.9%
remove-double-neg91.9%
Simplified91.9%
Taylor expanded in y around 0 90.5%
if 4.89999999999999988e-60 < z Initial program 100.0%
clear-num99.9%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 87.4%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.9e+40) (not (<= z 7.5e-44))) (+ y x) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e+40) || !(z <= 7.5e-44)) {
tmp = y + x;
} 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 <= (-3.9d+40)) .or. (.not. (z <= 7.5d-44))) then
tmp = y + x
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 <= -3.9e+40) || !(z <= 7.5e-44)) {
tmp = y + x;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.9e+40) or not (z <= 7.5e-44): tmp = y + x else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.9e+40) || !(z <= 7.5e-44)) tmp = Float64(y + x); 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 <= -3.9e+40) || ~((z <= 7.5e-44))) tmp = y + x; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.9e+40], N[Not[LessEqual[z, 7.5e-44]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+40} \lor \neg \left(z \leq 7.5 \cdot 10^{-44}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -3.9000000000000001e40 or 7.50000000000000008e-44 < z Initial program 99.9%
Taylor expanded in z around inf 78.7%
+-commutative78.7%
Simplified78.7%
if -3.9000000000000001e40 < z < 7.50000000000000008e-44Initial program 97.0%
clear-num97.0%
un-div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in z around 0 80.5%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.95e+40) (not (<= z 3.4e-36))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.95e+40) || !(z <= 3.4e-36)) {
tmp = y + x;
} 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.95d+40)) .or. (.not. (z <= 3.4d-36))) then
tmp = y + x
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.95e+40) || !(z <= 3.4e-36)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.95e+40) or not (z <= 3.4e-36): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.95e+40) || !(z <= 3.4e-36)) tmp = Float64(y + x); 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.95e+40) || ~((z <= 3.4e-36))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.95e+40], N[Not[LessEqual[z, 3.4e-36]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+40} \lor \neg \left(z \leq 3.4 \cdot 10^{-36}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.95e40 or 3.4000000000000003e-36 < z Initial program 99.9%
Taylor expanded in z around inf 78.7%
+-commutative78.7%
Simplified78.7%
if -1.95e40 < z < 3.4000000000000003e-36Initial program 97.0%
Taylor expanded in z around 0 78.5%
*-commutative78.5%
associate-/l*80.5%
Simplified80.5%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e-120) (not (<= z 2.05e-81))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-120) || !(z <= 2.05e-81)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1d-120)) .or. (.not. (z <= 2.05d-81))) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-120) || !(z <= 2.05e-81)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e-120) or not (z <= 2.05e-81): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e-120) || !(z <= 2.05e-81)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1e-120) || ~((z <= 2.05e-81))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e-120], N[Not[LessEqual[z, 2.05e-81]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-120} \lor \neg \left(z \leq 2.05 \cdot 10^{-81}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.99999999999999979e-121 or 2.04999999999999992e-81 < z Initial program 99.9%
Taylor expanded in z around inf 73.5%
+-commutative73.5%
Simplified73.5%
if -9.99999999999999979e-121 < z < 2.04999999999999992e-81Initial program 96.0%
Taylor expanded in x around inf 52.3%
Final simplification65.6%
(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.4%
(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.4%
Taylor expanded in x around inf 48.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 2024106
(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)))))