
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{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 87.4%
associate-/l*97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* t (/ y z)))))
(if (<= z -8.5e+92)
(+ x y)
(if (<= z -1.8e-27)
t_1
(if (<= z -3.25e-87)
(+ x (/ y (/ a t)))
(if (<= z -7.2e-116)
t_1
(if (<= z 1.1e-194)
(+ x (* y (/ t a)))
(if (<= z 3.8e+33) t_1 (+ x y)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / z));
double tmp;
if (z <= -8.5e+92) {
tmp = x + y;
} else if (z <= -1.8e-27) {
tmp = t_1;
} else if (z <= -3.25e-87) {
tmp = x + (y / (a / t));
} else if (z <= -7.2e-116) {
tmp = t_1;
} else if (z <= 1.1e-194) {
tmp = x + (y * (t / a));
} else if (z <= 3.8e+33) {
tmp = t_1;
} else {
tmp = x + y;
}
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) :: t_1
real(8) :: tmp
t_1 = x - (t * (y / z))
if (z <= (-8.5d+92)) then
tmp = x + y
else if (z <= (-1.8d-27)) then
tmp = t_1
else if (z <= (-3.25d-87)) then
tmp = x + (y / (a / t))
else if (z <= (-7.2d-116)) then
tmp = t_1
else if (z <= 1.1d-194) then
tmp = x + (y * (t / a))
else if (z <= 3.8d+33) then
tmp = t_1
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / z));
double tmp;
if (z <= -8.5e+92) {
tmp = x + y;
} else if (z <= -1.8e-27) {
tmp = t_1;
} else if (z <= -3.25e-87) {
tmp = x + (y / (a / t));
} else if (z <= -7.2e-116) {
tmp = t_1;
} else if (z <= 1.1e-194) {
tmp = x + (y * (t / a));
} else if (z <= 3.8e+33) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t * (y / z)) tmp = 0 if z <= -8.5e+92: tmp = x + y elif z <= -1.8e-27: tmp = t_1 elif z <= -3.25e-87: tmp = x + (y / (a / t)) elif z <= -7.2e-116: tmp = t_1 elif z <= 1.1e-194: tmp = x + (y * (t / a)) elif z <= 3.8e+33: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t * Float64(y / z))) tmp = 0.0 if (z <= -8.5e+92) tmp = Float64(x + y); elseif (z <= -1.8e-27) tmp = t_1; elseif (z <= -3.25e-87) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= -7.2e-116) tmp = t_1; elseif (z <= 1.1e-194) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 3.8e+33) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t * (y / z)); tmp = 0.0; if (z <= -8.5e+92) tmp = x + y; elseif (z <= -1.8e-27) tmp = t_1; elseif (z <= -3.25e-87) tmp = x + (y / (a / t)); elseif (z <= -7.2e-116) tmp = t_1; elseif (z <= 1.1e-194) tmp = x + (y * (t / a)); elseif (z <= 3.8e+33) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+92], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.8e-27], t$95$1, If[LessEqual[z, -3.25e-87], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.2e-116], t$95$1, If[LessEqual[z, 1.1e-194], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+33], t$95$1, N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - t \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+92}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.25 \cdot 10^{-87}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-116}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-194}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -8.5000000000000001e92 or 3.80000000000000002e33 < z Initial program 75.0%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in z around inf 81.6%
if -8.5000000000000001e92 < z < -1.7999999999999999e-27 or -3.2500000000000001e-87 < z < -7.19999999999999951e-116 or 1.1000000000000001e-194 < z < 3.80000000000000002e33Initial program 98.6%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in t around inf 81.9%
associate-*r/81.9%
mul-1-neg81.9%
distribute-rgt-neg-out81.9%
associate-*l/82.0%
Simplified82.0%
Taylor expanded in z around inf 73.5%
+-commutative73.5%
mul-1-neg73.5%
unsub-neg73.5%
*-commutative73.5%
associate-*r/72.2%
Simplified72.2%
if -1.7999999999999999e-27 < z < -3.2500000000000001e-87Initial program 87.5%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around 0 74.5%
associate-/l*87.0%
Simplified87.0%
if -7.19999999999999951e-116 < z < 1.1000000000000001e-194Initial program 90.5%
+-commutative90.5%
associate-*r/98.4%
fma-def98.4%
Simplified98.4%
fma-udef98.4%
Applied egg-rr98.4%
Taylor expanded in z around 0 88.8%
Final simplification80.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.6e-77) (not (<= t 5e-63))) (- x (* t (/ y (- z a)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.6e-77) || !(t <= 5e-63)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-9.6d-77)) .or. (.not. (t <= 5d-63))) then
tmp = x - (t * (y / (z - a)))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.6e-77) || !(t <= 5e-63)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.6e-77) or not (t <= 5e-63): tmp = x - (t * (y / (z - a))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.6e-77) || !(t <= 5e-63)) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9.6e-77) || ~((t <= 5e-63))) tmp = x - (t * (y / (z - a))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.6e-77], N[Not[LessEqual[t, 5e-63]], $MachinePrecision]], N[(x - N[(t * N[(y / N[(z - a), $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 -9.6 \cdot 10^{-77} \lor \neg \left(t \leq 5 \cdot 10^{-63}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -9.59999999999999961e-77 or 5.0000000000000002e-63 < t Initial program 86.1%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in t around inf 82.5%
associate-*r/82.5%
mul-1-neg82.5%
distribute-rgt-neg-out82.5%
associate-*l/88.6%
Simplified88.6%
Taylor expanded in x around 0 82.5%
+-commutative82.5%
neg-mul-182.5%
sub-neg82.5%
*-commutative82.5%
associate-*r/88.6%
Simplified88.6%
if -9.59999999999999961e-77 < t < 5.0000000000000002e-63Initial program 89.2%
+-commutative89.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
fma-udef99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 91.2%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.9e-6) (+ x (/ y (/ a t))) (if (<= a 1.28e-51) (+ x (/ y (/ z (- z t)))) (+ x (* y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.9e-6) {
tmp = x + (y / (a / t));
} else if (a <= 1.28e-51) {
tmp = x + (y / (z / (z - t)));
} 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 <= (-2.9d-6)) then
tmp = x + (y / (a / t))
else if (a <= 1.28d-51) then
tmp = x + (y / (z / (z - t)))
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 <= -2.9e-6) {
tmp = x + (y / (a / t));
} else if (a <= 1.28e-51) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.9e-6: tmp = x + (y / (a / t)) elif a <= 1.28e-51: tmp = x + (y / (z / (z - t))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.9e-6) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (a <= 1.28e-51) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); 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 <= -2.9e-6) tmp = x + (y / (a / t)); elseif (a <= 1.28e-51) tmp = x + (y / (z / (z - t))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.9e-6], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.28e-51], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{-6}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;a \leq 1.28 \cdot 10^{-51}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -2.9000000000000002e-6Initial program 86.8%
associate-*l/95.6%
Simplified95.6%
Taylor expanded in z around 0 65.6%
associate-/l*73.3%
Simplified73.3%
if -2.9000000000000002e-6 < a < 1.28000000000000004e-51Initial program 89.5%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in a around 0 84.5%
if 1.28000000000000004e-51 < a Initial program 84.1%
+-commutative84.1%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
fma-udef99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 83.8%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.6e-11) (+ x (* y (/ z (- z a)))) (if (<= a 1.38e-52) (+ x (/ y (/ z (- z t)))) (+ x (* y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.6e-11) {
tmp = x + (y * (z / (z - a)));
} else if (a <= 1.38e-52) {
tmp = x + (y / (z / (z - t)));
} 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 <= (-2.6d-11)) then
tmp = x + (y * (z / (z - a)))
else if (a <= 1.38d-52) then
tmp = x + (y / (z / (z - t)))
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 <= -2.6e-11) {
tmp = x + (y * (z / (z - a)));
} else if (a <= 1.38e-52) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.6e-11: tmp = x + (y * (z / (z - a))) elif a <= 1.38e-52: tmp = x + (y / (z / (z - t))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.6e-11) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (a <= 1.38e-52) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); 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 <= -2.6e-11) tmp = x + (y * (z / (z - a))); elseif (a <= 1.38e-52) tmp = x + (y / (z / (z - t))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.6e-11], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.38e-52], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{-11}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;a \leq 1.38 \cdot 10^{-52}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -2.6000000000000001e-11Initial program 86.8%
+-commutative86.8%
associate-*r/99.8%
fma-def99.8%
Simplified99.8%
fma-udef99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 77.4%
if -2.6000000000000001e-11 < a < 1.38000000000000008e-52Initial program 89.5%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in a around 0 84.5%
if 1.38000000000000008e-52 < a Initial program 84.1%
+-commutative84.1%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
fma-udef99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 83.8%
Final simplification82.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.5e+80) (not (<= y 9.2e+159))) (* y (- 1.0 (/ t z))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.5e+80) || !(y <= 9.2e+159)) {
tmp = y * (1.0 - (t / z));
} else {
tmp = x + y;
}
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 ((y <= (-1.5d+80)) .or. (.not. (y <= 9.2d+159))) then
tmp = y * (1.0d0 - (t / z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.5e+80) || !(y <= 9.2e+159)) {
tmp = y * (1.0 - (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.5e+80) or not (y <= 9.2e+159): tmp = y * (1.0 - (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.5e+80) || !(y <= 9.2e+159)) tmp = Float64(y * Float64(1.0 - Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.5e+80) || ~((y <= 9.2e+159))) tmp = y * (1.0 - (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.5e+80], N[Not[LessEqual[y, 9.2e+159]], $MachinePrecision]], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+80} \lor \neg \left(y \leq 9.2 \cdot 10^{+159}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.49999999999999993e80 or 9.19999999999999981e159 < y Initial program 69.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 56.6%
Taylor expanded in y around inf 51.1%
if -1.49999999999999993e80 < y < 9.19999999999999981e159Initial program 94.2%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in z around inf 67.1%
Final simplification62.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -6e-27) (+ x y) (if (<= z 240000000.0) (+ x (* t (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e-27) {
tmp = x + y;
} else if (z <= 240000000.0) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
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 <= (-6d-27)) then
tmp = x + y
else if (z <= 240000000.0d0) then
tmp = x + (t * (y / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e-27) {
tmp = x + y;
} else if (z <= 240000000.0) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e-27: tmp = x + y elif z <= 240000000.0: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e-27) tmp = Float64(x + y); elseif (z <= 240000000.0) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e-27) tmp = x + y; elseif (z <= 240000000.0) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e-27], N[(x + y), $MachinePrecision], If[LessEqual[z, 240000000.0], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-27}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 240000000:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -6.0000000000000002e-27 or 2.4e8 < z Initial program 81.6%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in z around inf 76.4%
if -6.0000000000000002e-27 < z < 2.4e8Initial program 92.8%
sub-neg92.8%
distribute-rgt-in92.8%
Applied egg-rr92.8%
Taylor expanded in z around 0 69.8%
*-commutative69.8%
associate-*r/74.3%
Simplified74.3%
Final simplification75.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.15e+102) (+ x y) (if (<= z 5200000000.0) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.15e+102) {
tmp = x + y;
} else if (z <= 5200000000.0) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
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.15d+102)) then
tmp = x + y
else if (z <= 5200000000.0d0) then
tmp = x + (y * (t / a))
else
tmp = x + y
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.15e+102) {
tmp = x + y;
} else if (z <= 5200000000.0) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.15e+102: tmp = x + y elif z <= 5200000000.0: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.15e+102) tmp = Float64(x + y); elseif (z <= 5200000000.0) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.15e+102) tmp = x + y; elseif (z <= 5200000000.0) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.15e+102], N[(x + y), $MachinePrecision], If[LessEqual[z, 5200000000.0], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+102}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 5200000000:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.15e102 or 5.2e9 < z Initial program 76.8%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in z around inf 80.2%
if -2.15e102 < z < 5.2e9Initial program 93.5%
+-commutative93.5%
associate-*r/95.8%
fma-def95.8%
Simplified95.8%
fma-udef95.8%
Applied egg-rr95.8%
Taylor expanded in z around 0 72.8%
Final simplification75.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.16e+102) (+ x y) (if (<= z 4600000.0) (+ x (/ y (/ a t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.16e+102) {
tmp = x + y;
} else if (z <= 4600000.0) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
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.16d+102)) then
tmp = x + y
else if (z <= 4600000.0d0) then
tmp = x + (y / (a / t))
else
tmp = x + y
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.16e+102) {
tmp = x + y;
} else if (z <= 4600000.0) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.16e+102: tmp = x + y elif z <= 4600000.0: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.16e+102) tmp = Float64(x + y); elseif (z <= 4600000.0) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.16e+102) tmp = x + y; elseif (z <= 4600000.0) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.16e+102], N[(x + y), $MachinePrecision], If[LessEqual[z, 4600000.0], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.16 \cdot 10^{+102}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4600000:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.16000000000000005e102 or 4.6e6 < z Initial program 76.8%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in z around inf 80.2%
if -2.16000000000000005e102 < z < 4.6e6Initial program 93.5%
associate-*l/95.6%
Simplified95.6%
Taylor expanded in z around 0 68.3%
associate-/l*72.8%
Simplified72.8%
Final simplification75.5%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Initial program 87.4%
associate-*l/95.5%
Simplified95.5%
Final simplification95.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.5e-27) (+ x y) (if (<= z 8.5e-27) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e-27) {
tmp = x + y;
} else if (z <= 8.5e-27) {
tmp = x;
} else {
tmp = x + y;
}
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.5d-27)) then
tmp = x + y
else if (z <= 8.5d-27) then
tmp = x
else
tmp = x + y
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.5e-27) {
tmp = x + y;
} else if (z <= 8.5e-27) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.5e-27: tmp = x + y elif z <= 8.5e-27: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e-27) tmp = Float64(x + y); elseif (z <= 8.5e-27) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.5e-27) tmp = x + y; elseif (z <= 8.5e-27) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e-27], N[(x + y), $MachinePrecision], If[LessEqual[z, 8.5e-27], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-27}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.5000000000000001e-27 or 8.50000000000000033e-27 < z Initial program 82.9%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in z around inf 74.4%
if -1.5000000000000001e-27 < z < 8.50000000000000033e-27Initial program 92.2%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in x around inf 47.4%
Final simplification61.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 87.4%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in x around inf 51.1%
Final simplification51.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 2023196
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))