
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.2e+82)
(+ x (* y (- 1.0 (/ t z))))
(if (<= z -2.16e-72)
(+ x (* z (/ y (- z a))))
(if (<= z 4e-107) (+ x (/ y (/ a t))) (+ x (* y (/ z (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+82) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= -2.16e-72) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 4e-107) {
tmp = x + (y / (a / 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 (z <= (-5.2d+82)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if (z <= (-2.16d-72)) then
tmp = x + (z * (y / (z - a)))
else if (z <= 4d-107) then
tmp = x + (y / (a / 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 (z <= -5.2e+82) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= -2.16e-72) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 4e-107) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+82: tmp = x + (y * (1.0 - (t / z))) elif z <= -2.16e-72: tmp = x + (z * (y / (z - a))) elif z <= 4e-107: tmp = x + (y / (a / t)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+82) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (z <= -2.16e-72) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); elseif (z <= 4e-107) tmp = Float64(x + Float64(y / Float64(a / 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 (z <= -5.2e+82) tmp = x + (y * (1.0 - (t / z))); elseif (z <= -2.16e-72) tmp = x + (z * (y / (z - a))); elseif (z <= 4e-107) tmp = x + (y / (a / t)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+82], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.16e-72], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-107], N[(x + N[(y / N[(a / t), $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 -5.2 \cdot 10^{+82}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq -2.16 \cdot 10^{-72}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-107}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -5.1999999999999997e82Initial program 100.0%
Taylor expanded in a around 0 91.4%
div-sub91.4%
*-inverses91.4%
Simplified91.4%
if -5.1999999999999997e82 < z < -2.15999999999999996e-72Initial program 99.8%
Taylor expanded in t around 0 78.0%
associate-/l*83.2%
Simplified83.2%
associate-/r/86.3%
Applied egg-rr86.3%
if -2.15999999999999996e-72 < z < 4e-107Initial program 97.8%
Taylor expanded in z around 0 84.3%
associate-/l*80.0%
associate-/r/84.3%
Applied egg-rr84.3%
*-commutative84.3%
clear-num84.2%
un-div-inv84.4%
Applied egg-rr84.4%
if 4e-107 < z Initial program 99.9%
Taylor expanded in t around 0 89.1%
Final simplification87.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e-86) (not (<= z 32500.0))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e-86) || !(z <= 32500.0)) {
tmp = x + (y * (1.0 - (t / z)));
} 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.75d-86)) .or. (.not. (z <= 32500.0d0))) then
tmp = x + (y * (1.0d0 - (t / z)))
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.75e-86) || !(z <= 32500.0)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e-86) or not (z <= 32500.0): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e-86) || !(z <= 32500.0)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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.75e-86) || ~((z <= 32500.0))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e-86], N[Not[LessEqual[z, 32500.0]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-86} \lor \neg \left(z \leq 32500\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.7500000000000001e-86 or 32500 < z Initial program 99.9%
Taylor expanded in a around 0 86.8%
div-sub86.8%
*-inverses86.8%
Simplified86.8%
if -1.7500000000000001e-86 < z < 32500Initial program 98.2%
Taylor expanded in z around 0 84.5%
associate-/l*81.0%
associate-/r/83.7%
Applied egg-rr83.7%
*-commutative83.7%
clear-num83.6%
un-div-inv84.5%
Applied egg-rr84.5%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.1e+52) (not (<= t 6e+37))) (- x (* y (/ t (- z a)))) (+ x (* z (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e+52) || !(t <= 6e+37)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (z * (y / (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 <= (-4.1d+52)) .or. (.not. (t <= 6d+37))) then
tmp = x - (y * (t / (z - a)))
else
tmp = x + (z * (y / (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 <= -4.1e+52) || !(t <= 6e+37)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.1e+52) or not (t <= 6e+37): tmp = x - (y * (t / (z - a))) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.1e+52) || !(t <= 6e+37)) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.1e+52) || ~((t <= 6e+37))) tmp = x - (y * (t / (z - a))); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.1e+52], N[Not[LessEqual[t, 6e+37]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+52} \lor \neg \left(t \leq 6 \cdot 10^{+37}\right):\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -4.1e52 or 6.00000000000000043e37 < t Initial program 98.2%
Taylor expanded in t around inf 86.9%
neg-mul-186.9%
distribute-neg-frac86.9%
Simplified86.9%
*-commutative86.9%
add-sqr-sqrt43.7%
sqrt-unprod38.1%
sqr-neg38.1%
sqrt-unprod19.8%
add-sqr-sqrt37.2%
cancel-sign-sub37.2%
distribute-frac-neg37.2%
*-commutative37.2%
add-sqr-sqrt17.4%
sqrt-unprod37.9%
sqr-neg37.9%
sqrt-unprod43.1%
add-sqr-sqrt86.9%
Applied egg-rr86.9%
if -4.1e52 < t < 6.00000000000000043e37Initial program 99.9%
Taylor expanded in t around 0 77.3%
associate-/l*92.3%
Simplified92.3%
associate-/r/94.3%
Applied egg-rr94.3%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.4e-85) (+ x (* y (- 1.0 (/ t z)))) (if (<= z 2.1e-107) (+ x (/ y (/ a t))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e-85) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= 2.1e-107) {
tmp = x + (y / (a / 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 (z <= (-1.4d-85)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if (z <= 2.1d-107) then
tmp = x + (y / (a / 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 (z <= -1.4e-85) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= 2.1e-107) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.4e-85: tmp = x + (y * (1.0 - (t / z))) elif z <= 2.1e-107: tmp = x + (y / (a / t)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.4e-85) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (z <= 2.1e-107) tmp = Float64(x + Float64(y / Float64(a / 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 (z <= -1.4e-85) tmp = x + (y * (1.0 - (t / z))); elseif (z <= 2.1e-107) tmp = x + (y / (a / t)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e-85], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-107], N[(x + N[(y / N[(a / t), $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.4 \cdot 10^{-85}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-107}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -1.40000000000000008e-85Initial program 99.9%
Taylor expanded in a around 0 82.6%
div-sub82.6%
*-inverses82.6%
Simplified82.6%
if -1.40000000000000008e-85 < z < 2.0999999999999999e-107Initial program 97.7%
Taylor expanded in z around 0 86.1%
associate-/l*81.6%
associate-/r/86.1%
Applied egg-rr86.1%
*-commutative86.1%
clear-num86.0%
un-div-inv86.1%
Applied egg-rr86.1%
if 2.0999999999999999e-107 < z Initial program 99.9%
Taylor expanded in t around 0 89.1%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.3e-27) (+ x (* y (- 1.0 (/ t z)))) (if (<= z 66000.0) (+ x (/ t (/ (- a z) y))) (+ x (- y (* t (/ y z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e-27) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= 66000.0) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + (y - (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 <= (-3.3d-27)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if (z <= 66000.0d0) then
tmp = x + (t / ((a - z) / y))
else
tmp = x + (y - (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 <= -3.3e-27) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= 66000.0) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + (y - (t * (y / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.3e-27: tmp = x + (y * (1.0 - (t / z))) elif z <= 66000.0: tmp = x + (t / ((a - z) / y)) else: tmp = x + (y - (t * (y / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.3e-27) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (z <= 66000.0) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); else tmp = Float64(x + Float64(y - Float64(t * Float64(y / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.3e-27) tmp = x + (y * (1.0 - (t / z))); elseif (z <= 66000.0) tmp = x + (t / ((a - z) / y)); else tmp = x + (y - (t * (y / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e-27], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 66000.0], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-27}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 66000:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - t \cdot \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -3.29999999999999998e-27Initial program 100.0%
Taylor expanded in a around 0 87.7%
div-sub87.7%
*-inverses87.7%
Simplified87.7%
if -3.29999999999999998e-27 < z < 66000Initial program 98.4%
Taylor expanded in t around inf 91.1%
neg-mul-191.1%
distribute-neg-frac91.1%
Simplified91.1%
frac-2neg91.1%
remove-double-neg91.1%
associate-*r/91.7%
Applied egg-rr91.7%
associate-/l*91.1%
neg-sub091.1%
associate--r-91.1%
neg-sub091.1%
Simplified91.1%
Taylor expanded in x around 0 91.7%
+-commutative91.7%
associate-/l*89.8%
Simplified89.8%
if 66000 < z Initial program 99.9%
Taylor expanded in a around 0 71.8%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in z around 0 83.4%
+-commutative83.4%
mul-1-neg83.4%
unsub-neg83.4%
associate-*r/92.3%
Simplified92.3%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -4e+51) (+ x (/ y (/ (- a z) t))) (if (<= t 3.1e+37) (+ x (* z (/ y (- z a)))) (- x (* y (/ t (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e+51) {
tmp = x + (y / ((a - z) / t));
} else if (t <= 3.1e+37) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-4d+51)) then
tmp = x + (y / ((a - z) / t))
else if (t <= 3.1d+37) then
tmp = x + (z * (y / (z - a)))
else
tmp = x - (y * (t / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e+51) {
tmp = x + (y / ((a - z) / t));
} else if (t <= 3.1e+37) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4e+51: tmp = x + (y / ((a - z) / t)) elif t <= 3.1e+37: tmp = x + (z * (y / (z - a))) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4e+51) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); elseif (t <= 3.1e+37) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4e+51) tmp = x + (y / ((a - z) / t)); elseif (t <= 3.1e+37) tmp = x + (z * (y / (z - a))); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4e+51], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e+37], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+51}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+37}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if t < -4e51Initial program 96.5%
Taylor expanded in t around inf 84.4%
neg-mul-184.4%
distribute-neg-frac84.4%
Simplified84.4%
frac-2neg84.4%
remove-double-neg84.4%
associate-*r/84.4%
Applied egg-rr84.4%
associate-/l*84.5%
neg-sub084.5%
associate--r-84.5%
neg-sub084.5%
Simplified84.5%
if -4e51 < t < 3.1000000000000002e37Initial program 99.9%
Taylor expanded in t around 0 77.3%
associate-/l*92.3%
Simplified92.3%
associate-/r/94.3%
Applied egg-rr94.3%
if 3.1000000000000002e37 < t Initial program 100.0%
Taylor expanded in t around inf 89.7%
neg-mul-189.7%
distribute-neg-frac89.7%
Simplified89.7%
*-commutative89.7%
add-sqr-sqrt0.0%
sqrt-unprod23.8%
sqr-neg23.8%
sqrt-unprod41.1%
add-sqr-sqrt41.1%
cancel-sign-sub41.1%
distribute-frac-neg41.1%
*-commutative41.1%
add-sqr-sqrt0.0%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod89.5%
add-sqr-sqrt89.7%
Applied egg-rr89.7%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.35e-26) (not (<= z 6800000.0))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.35e-26) || !(z <= 6800000.0)) {
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.35d-26)) .or. (.not. (z <= 6800000.0d0))) 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.35e-26) || !(z <= 6800000.0)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.35e-26) or not (z <= 6800000.0): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.35e-26) || !(z <= 6800000.0)) 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.35e-26) || ~((z <= 6800000.0))) 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.35e-26], N[Not[LessEqual[z, 6800000.0]], $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.35 \cdot 10^{-26} \lor \neg \left(z \leq 6800000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.34999999999999995e-26 or 6.8e6 < z Initial program 99.9%
Taylor expanded in z around inf 80.9%
if -2.34999999999999995e-26 < z < 6.8e6Initial program 98.4%
Taylor expanded in z around 0 80.4%
Final simplification80.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.7e-27) (not (<= z 75000.0))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e-27) || !(z <= 75000.0)) {
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 <= (-2.7d-27)) .or. (.not. (z <= 75000.0d0))) 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 <= -2.7e-27) || !(z <= 75000.0)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e-27) or not (z <= 75000.0): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e-27) || !(z <= 75000.0)) 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 <= -2.7e-27) || ~((z <= 75000.0))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e-27], N[Not[LessEqual[z, 75000.0]], $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 -2.7 \cdot 10^{-27} \lor \neg \left(z \leq 75000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.69999999999999989e-27 or 75000 < z Initial program 99.9%
Taylor expanded in z around inf 80.9%
if -2.69999999999999989e-27 < z < 75000Initial program 98.4%
Taylor expanded in z around 0 80.3%
associate-/l*78.0%
associate-/r/80.4%
Applied egg-rr80.4%
*-commutative80.4%
clear-num80.3%
un-div-inv81.1%
Applied egg-rr81.1%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -6e+170) x (if (<= a 3.4e+58) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6e+170) {
tmp = x;
} else if (a <= 3.4e+58) {
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 <= (-6d+170)) then
tmp = x
else if (a <= 3.4d+58) 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 <= -6e+170) {
tmp = x;
} else if (a <= 3.4e+58) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6e+170: tmp = x elif a <= 3.4e+58: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6e+170) tmp = x; elseif (a <= 3.4e+58) 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 <= -6e+170) tmp = x; elseif (a <= 3.4e+58) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6e+170], x, If[LessEqual[a, 3.4e+58], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+170}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+58}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.99999999999999994e170 or 3.4000000000000001e58 < a Initial program 99.9%
Taylor expanded in z around 0 83.5%
Taylor expanded in x around inf 75.8%
if -5.99999999999999994e170 < a < 3.4000000000000001e58Initial program 98.9%
Taylor expanded in z around inf 66.5%
Final simplification69.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 99.2%
Taylor expanded in z around 0 62.0%
Taylor expanded in x around inf 52.1%
Final simplification52.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 2023308
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))