
(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 (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 (<= z -9.5e-40)
(+ y x)
(if (<= z 3.2)
(+ x (* y (/ t a)))
(if (or (<= z 3.4e+130) (not (<= z 9.5e+180)))
(+ y x)
(- x (* t (/ y z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-40) {
tmp = y + x;
} else if (z <= 3.2) {
tmp = x + (y * (t / a));
} else if ((z <= 3.4e+130) || !(z <= 9.5e+180)) {
tmp = y + x;
} else {
tmp = x - (t * (y / 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 <= (-9.5d-40)) then
tmp = y + x
else if (z <= 3.2d0) then
tmp = x + (y * (t / a))
else if ((z <= 3.4d+130) .or. (.not. (z <= 9.5d+180))) then
tmp = y + x
else
tmp = x - (t * (y / 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 <= -9.5e-40) {
tmp = y + x;
} else if (z <= 3.2) {
tmp = x + (y * (t / a));
} else if ((z <= 3.4e+130) || !(z <= 9.5e+180)) {
tmp = y + x;
} else {
tmp = x - (t * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.5e-40: tmp = y + x elif z <= 3.2: tmp = x + (y * (t / a)) elif (z <= 3.4e+130) or not (z <= 9.5e+180): tmp = y + x else: tmp = x - (t * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e-40) tmp = Float64(y + x); elseif (z <= 3.2) tmp = Float64(x + Float64(y * Float64(t / a))); elseif ((z <= 3.4e+130) || !(z <= 9.5e+180)) tmp = Float64(y + x); else tmp = Float64(x - Float64(t * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.5e-40) tmp = y + x; elseif (z <= 3.2) tmp = x + (y * (t / a)); elseif ((z <= 3.4e+130) || ~((z <= 9.5e+180))) tmp = y + x; else tmp = x - (t * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e-40], N[(y + x), $MachinePrecision], If[LessEqual[z, 3.2], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.4e+130], N[Not[LessEqual[z, 9.5e+180]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-40}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 3.2:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+130} \lor \neg \left(z \leq 9.5 \cdot 10^{+180}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -9.5000000000000006e-40 or 3.2000000000000002 < z < 3.4000000000000001e130 or 9.5000000000000003e180 < z Initial program 99.9%
Taylor expanded in z around inf 78.1%
+-commutative78.1%
Simplified78.1%
if -9.5000000000000006e-40 < z < 3.2000000000000002Initial program 96.5%
Taylor expanded in z around 0 71.8%
*-commutative71.8%
associate-/l*73.7%
Simplified73.7%
if 3.4000000000000001e130 < z < 9.5000000000000003e180Initial program 99.7%
Taylor expanded in t around inf 70.2%
mul-1-neg70.2%
associate-/l*86.4%
distribute-rgt-neg-in86.4%
distribute-frac-neg286.4%
sub-neg86.4%
distribute-neg-in86.4%
remove-double-neg86.4%
Simplified86.4%
Taylor expanded in z around inf 70.3%
mul-1-neg70.3%
unsub-neg70.3%
associate-/l*86.6%
Simplified86.6%
Final simplification76.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.0074) (not (<= t 3.2e+123))) (+ x (* t (/ y (- a z)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.0074) || !(t <= 3.2e+123)) {
tmp = x + (t * (y / (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 ((t <= (-0.0074d0)) .or. (.not. (t <= 3.2d+123))) then
tmp = x + (t * (y / (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 ((t <= -0.0074) || !(t <= 3.2e+123)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.0074) or not (t <= 3.2e+123): tmp = x + (t * (y / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.0074) || !(t <= 3.2e+123)) tmp = Float64(x + Float64(t * Float64(y / 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 ((t <= -0.0074) || ~((t <= 3.2e+123))) tmp = x + (t * (y / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.0074], N[Not[LessEqual[t, 3.2e+123]], $MachinePrecision]], N[(x + N[(t * N[(y / 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}\;t \leq -0.0074 \lor \neg \left(t \leq 3.2 \cdot 10^{+123}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -0.0074000000000000003 or 3.20000000000000005e123 < t Initial program 96.2%
Taylor expanded in t around inf 78.6%
mul-1-neg78.6%
associate-/l*91.0%
distribute-rgt-neg-in91.0%
distribute-frac-neg291.0%
sub-neg91.0%
distribute-neg-in91.0%
remove-double-neg91.0%
Simplified91.0%
if -0.0074000000000000003 < t < 3.20000000000000005e123Initial program 99.8%
Taylor expanded in t around 0 74.7%
associate-/l*89.1%
Simplified89.1%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.26e-51) (not (<= z 3.2e-105))) (+ x (* y (/ z (- z a)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.26e-51) || !(z <= 3.2e-105)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.26d-51)) .or. (.not. (z <= 3.2d-105))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.26e-51) || !(z <= 3.2e-105)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.26e-51) or not (z <= 3.2e-105): tmp = x + (y * (z / (z - a))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.26e-51) || !(z <= 3.2e-105)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.26e-51) || ~((z <= 3.2e-105))) tmp = x + (y * (z / (z - a))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.26e-51], N[Not[LessEqual[z, 3.2e-105]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{-51} \lor \neg \left(z \leq 3.2 \cdot 10^{-105}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.2600000000000001e-51 or 3.19999999999999981e-105 < z Initial program 98.8%
Taylor expanded in t around 0 63.8%
associate-/l*80.2%
Simplified80.2%
if -1.2600000000000001e-51 < z < 3.19999999999999981e-105Initial program 97.6%
Taylor expanded in z around 0 74.0%
*-commutative74.0%
associate-/l*78.1%
Simplified78.1%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.5e-17) (+ x (* y (/ (- z t) z))) (if (<= z 2.6e-64) (+ 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 <= -3.5e-17) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 2.6e-64) {
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 <= (-3.5d-17)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 2.6d-64) 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 <= -3.5e-17) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 2.6e-64) {
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 <= -3.5e-17: tmp = x + (y * ((z - t) / z)) elif z <= 2.6e-64: 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 <= -3.5e-17) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 2.6e-64) tmp = Float64(x + Float64(Float64(y * 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 <= -3.5e-17) tmp = x + (y * ((z - t) / z)); elseif (z <= 2.6e-64) 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, -3.5e-17], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-64], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $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 -3.5 \cdot 10^{-17}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-64}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -3.5000000000000002e-17Initial program 99.9%
Taylor expanded in a around 0 91.6%
if -3.5000000000000002e-17 < z < 2.6e-64Initial program 96.2%
Taylor expanded in t around inf 88.0%
mul-1-neg88.0%
associate-/l*88.8%
distribute-rgt-neg-in88.8%
distribute-frac-neg288.8%
sub-neg88.8%
distribute-neg-in88.8%
remove-double-neg88.8%
Simplified88.8%
Taylor expanded in t around 0 88.0%
*-commutative88.0%
Simplified88.0%
if 2.6e-64 < z Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 85.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.2e+81) (+ x (* t (/ y a))) (if (<= a 6.5e-72) (+ x (/ y (/ z (- z t)))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e+81) {
tmp = x + (t * (y / a));
} else if (a <= 6.5e-72) {
tmp = x + (y / (z / (z - t)));
} 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 (a <= (-3.2d+81)) then
tmp = x + (t * (y / a))
else if (a <= 6.5d-72) then
tmp = x + (y / (z / (z - t)))
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 (a <= -3.2e+81) {
tmp = x + (t * (y / a));
} else if (a <= 6.5e-72) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.2e+81: tmp = x + (t * (y / a)) elif a <= 6.5e-72: tmp = x + (y / (z / (z - t))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.2e+81) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (a <= 6.5e-72) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); 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 (a <= -3.2e+81) tmp = x + (t * (y / a)); elseif (a <= 6.5e-72) tmp = x + (y / (z / (z - t))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.2e+81], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.5e-72], N[(x + N[(y / N[(z / N[(z - t), $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}\;a \leq -3.2 \cdot 10^{+81}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-72}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if a < -3.2e81Initial program 99.4%
clear-num97.5%
un-div-inv97.4%
Applied egg-rr97.4%
Taylor expanded in z around 0 75.5%
+-commutative75.5%
associate-/l*79.9%
Simplified79.9%
if -3.2e81 < a < 6.4999999999999997e-72Initial program 97.3%
clear-num97.3%
un-div-inv97.3%
Applied egg-rr97.3%
Taylor expanded in a around 0 88.1%
if 6.4999999999999997e-72 < a Initial program 99.9%
Taylor expanded in t around 0 63.1%
associate-/l*82.0%
Simplified82.0%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.35e+82) (+ x (* t (/ y a))) (if (<= a 7.6e-107) (+ x (* y (/ (- z t) z))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.35e+82) {
tmp = x + (t * (y / a));
} else if (a <= 7.6e-107) {
tmp = x + (y * ((z - t) / 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 (a <= (-1.35d+82)) then
tmp = x + (t * (y / a))
else if (a <= 7.6d-107) then
tmp = x + (y * ((z - t) / 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 (a <= -1.35e+82) {
tmp = x + (t * (y / a));
} else if (a <= 7.6e-107) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.35e+82: tmp = x + (t * (y / a)) elif a <= 7.6e-107: tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.35e+82) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (a <= 7.6e-107) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / 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 (a <= -1.35e+82) tmp = x + (t * (y / a)); elseif (a <= 7.6e-107) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.35e+82], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.6e-107], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+82}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 7.6 \cdot 10^{-107}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if a < -1.35e82Initial program 99.4%
clear-num97.5%
un-div-inv97.4%
Applied egg-rr97.4%
Taylor expanded in z around 0 75.5%
+-commutative75.5%
associate-/l*79.9%
Simplified79.9%
if -1.35e82 < a < 7.6000000000000004e-107Initial program 97.0%
Taylor expanded in a around 0 89.2%
if 7.6000000000000004e-107 < a Initial program 99.9%
Taylor expanded in t around 0 62.0%
associate-/l*80.3%
Simplified80.3%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.7e-40) (not (<= z 140.0))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e-40) || !(z <= 140.0)) {
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 <= (-2.7d-40)) .or. (.not. (z <= 140.0d0))) 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 <= -2.7e-40) || !(z <= 140.0)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e-40) or not (z <= 140.0): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e-40) || !(z <= 140.0)) 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 <= -2.7e-40) || ~((z <= 140.0))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e-40], N[Not[LessEqual[z, 140.0]], $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 -2.7 \cdot 10^{-40} \lor \neg \left(z \leq 140\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.7e-40 or 140 < z Initial program 99.9%
Taylor expanded in z around inf 75.9%
+-commutative75.9%
Simplified75.9%
if -2.7e-40 < z < 140Initial program 96.5%
Taylor expanded in z around 0 71.8%
*-commutative71.8%
associate-/l*73.7%
Simplified73.7%
Final simplification75.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.62e+184) (not (<= t 7.2e+115))) (* y (/ t (- a z))) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.62e+184) || !(t <= 7.2e+115)) {
tmp = y * (t / (a - z));
} else {
tmp = y + 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 ((t <= (-1.62d+184)) .or. (.not. (t <= 7.2d+115))) then
tmp = y * (t / (a - z))
else
tmp = y + x
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.62e+184) || !(t <= 7.2e+115)) {
tmp = y * (t / (a - z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.62e+184) or not (t <= 7.2e+115): tmp = y * (t / (a - z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.62e+184) || !(t <= 7.2e+115)) tmp = Float64(y * Float64(t / Float64(a - z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.62e+184) || ~((t <= 7.2e+115))) tmp = y * (t / (a - z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.62e+184], N[Not[LessEqual[t, 7.2e+115]], $MachinePrecision]], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.62 \cdot 10^{+184} \lor \neg \left(t \leq 7.2 \cdot 10^{+115}\right):\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.61999999999999999e184 or 7.2000000000000001e115 < t Initial program 94.8%
Taylor expanded in t around inf 74.3%
mul-1-neg74.3%
associate-/l*91.2%
distribute-rgt-neg-in91.2%
distribute-frac-neg291.2%
sub-neg91.2%
distribute-neg-in91.2%
remove-double-neg91.2%
Simplified91.2%
Taylor expanded in y around inf 79.4%
+-commutative79.4%
Simplified79.4%
Taylor expanded in x around 0 64.9%
if -1.61999999999999999e184 < t < 7.2000000000000001e115Initial program 99.8%
Taylor expanded in z around inf 73.3%
+-commutative73.3%
Simplified73.3%
Final simplification71.0%
(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 (if (<= a 2.6e+153) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2.6e+153) {
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 (a <= 2.6d+153) 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 (a <= 2.6e+153) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 2.6e+153: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2.6e+153) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 2.6e+153) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2.6e+153], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.6 \cdot 10^{+153}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 2.5999999999999999e153Initial program 98.2%
Taylor expanded in z around inf 61.5%
+-commutative61.5%
Simplified61.5%
if 2.5999999999999999e153 < a Initial program 99.9%
Taylor expanded in x around inf 76.3%
(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 47.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 2024096
(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)))))