
(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 17 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 (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 86.0%
+-commutative86.0%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.8e+119)
(+ x (* y (/ z (- z a))))
(if (<= z -8.2e-55)
(+ x (* y (/ (- z t) z)))
(if (<= z 1.62e-158) (+ x (/ (* y t) a)) (+ x (* z (/ y (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.8e+119) {
tmp = x + (y * (z / (z - a)));
} else if (z <= -8.2e-55) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.62e-158) {
tmp = x + ((y * t) / 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 (z <= (-8.8d+119)) then
tmp = x + (y * (z / (z - a)))
else if (z <= (-8.2d-55)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 1.62d-158) then
tmp = x + ((y * t) / 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 (z <= -8.8e+119) {
tmp = x + (y * (z / (z - a)));
} else if (z <= -8.2e-55) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.62e-158) {
tmp = x + ((y * t) / a);
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.8e+119: tmp = x + (y * (z / (z - a))) elif z <= -8.2e-55: tmp = x + (y * ((z - t) / z)) elif z <= 1.62e-158: tmp = x + ((y * t) / a) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.8e+119) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= -8.2e-55) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 1.62e-158) tmp = Float64(x + Float64(Float64(y * t) / 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 (z <= -8.8e+119) tmp = x + (y * (z / (z - a))); elseif (z <= -8.2e-55) tmp = x + (y * ((z - t) / z)); elseif (z <= 1.62e-158) tmp = x + ((y * t) / a); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.8e+119], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.2e-55], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.62e-158], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+119}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-55}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 1.62 \cdot 10^{-158}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -8.8000000000000005e119Initial program 54.6%
Taylor expanded in t around 0 57.9%
associate-/l*91.9%
Simplified91.9%
if -8.8000000000000005e119 < z < -8.1999999999999996e-55Initial program 91.7%
+-commutative91.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 80.9%
+-commutative80.9%
associate-/l*83.6%
Simplified83.6%
if -8.1999999999999996e-55 < z < 1.62000000000000002e-158Initial program 98.3%
Taylor expanded in z around 0 89.8%
if 1.62000000000000002e-158 < z Initial program 85.0%
+-commutative85.0%
associate-/l*98.9%
fma-define98.9%
Simplified98.9%
fma-undefine98.9%
associate-/l*85.0%
div-inv84.9%
*-commutative84.9%
associate-*r*98.7%
div-inv98.8%
Applied egg-rr98.8%
Taylor expanded in z around inf 80.2%
Final simplification86.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -1.15e+120)
t_1
(if (<= z -1.7e-55)
(+ x (* y (/ (- z t) z)))
(if (<= z 1.62e-158) (+ x (/ (* y t) a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -1.15e+120) {
tmp = t_1;
} else if (z <= -1.7e-55) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.62e-158) {
tmp = x + ((y * t) / a);
} else {
tmp = t_1;
}
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 + (y * (z / (z - a)))
if (z <= (-1.15d+120)) then
tmp = t_1
else if (z <= (-1.7d-55)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 1.62d-158) then
tmp = x + ((y * t) / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -1.15e+120) {
tmp = t_1;
} else if (z <= -1.7e-55) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.62e-158) {
tmp = x + ((y * t) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -1.15e+120: tmp = t_1 elif z <= -1.7e-55: tmp = x + (y * ((z - t) / z)) elif z <= 1.62e-158: tmp = x + ((y * t) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -1.15e+120) tmp = t_1; elseif (z <= -1.7e-55) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 1.62e-158) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -1.15e+120) tmp = t_1; elseif (z <= -1.7e-55) tmp = x + (y * ((z - t) / z)); elseif (z <= 1.62e-158) tmp = x + ((y * t) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e+120], t$95$1, If[LessEqual[z, -1.7e-55], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.62e-158], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-55}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 1.62 \cdot 10^{-158}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.14999999999999996e120 or 1.62000000000000002e-158 < z Initial program 75.6%
Taylor expanded in t around 0 63.8%
associate-/l*83.1%
Simplified83.1%
if -1.14999999999999996e120 < z < -1.69999999999999986e-55Initial program 91.7%
+-commutative91.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 80.9%
+-commutative80.9%
associate-/l*83.6%
Simplified83.6%
if -1.69999999999999986e-55 < z < 1.62000000000000002e-158Initial program 98.3%
Taylor expanded in z around 0 89.8%
Final simplification85.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.8e+160)
(+ y x)
(if (<= z -4.25e-10)
(- x (* t (/ y z)))
(if (<= z 1.7e+33) (+ x (/ t (/ a y))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.8e+160) {
tmp = y + x;
} else if (z <= -4.25e-10) {
tmp = x - (t * (y / z));
} else if (z <= 1.7e+33) {
tmp = x + (t / (a / y));
} 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 (z <= (-8.8d+160)) then
tmp = y + x
else if (z <= (-4.25d-10)) then
tmp = x - (t * (y / z))
else if (z <= 1.7d+33) then
tmp = x + (t / (a / y))
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 (z <= -8.8e+160) {
tmp = y + x;
} else if (z <= -4.25e-10) {
tmp = x - (t * (y / z));
} else if (z <= 1.7e+33) {
tmp = x + (t / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.8e+160: tmp = y + x elif z <= -4.25e-10: tmp = x - (t * (y / z)) elif z <= 1.7e+33: tmp = x + (t / (a / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.8e+160) tmp = Float64(y + x); elseif (z <= -4.25e-10) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 1.7e+33) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.8e+160) tmp = y + x; elseif (z <= -4.25e-10) tmp = x - (t * (y / z)); elseif (z <= 1.7e+33) tmp = x + (t / (a / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.8e+160], N[(y + x), $MachinePrecision], If[LessEqual[z, -4.25e-10], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+33], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+160}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -4.25 \cdot 10^{-10}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+33}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -8.79999999999999968e160 or 1.7e33 < z Initial program 70.3%
+-commutative70.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 84.6%
+-commutative84.6%
Simplified84.6%
if -8.79999999999999968e160 < z < -4.2499999999999998e-10Initial program 78.7%
+-commutative78.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 70.8%
+-commutative70.8%
associate-/l*79.6%
Simplified79.6%
Taylor expanded in z around 0 70.4%
mul-1-neg70.4%
associate-/l*75.9%
distribute-rgt-neg-in75.9%
distribute-neg-frac275.9%
Simplified75.9%
if -4.2499999999999998e-10 < z < 1.7e33Initial program 97.4%
+-commutative97.4%
associate-/l*97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in z around 0 77.1%
+-commutative77.1%
associate-/l*76.8%
Simplified76.8%
clear-num76.7%
un-div-inv78.3%
Applied egg-rr78.3%
Final simplification80.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.4e+160)
(+ y x)
(if (<= z -1.36e-10)
(- x (* y (/ t z)))
(if (<= z 3.6e+33) (+ x (/ t (/ a y))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.4e+160) {
tmp = y + x;
} else if (z <= -1.36e-10) {
tmp = x - (y * (t / z));
} else if (z <= 3.6e+33) {
tmp = x + (t / (a / y));
} 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 (z <= (-5.4d+160)) then
tmp = y + x
else if (z <= (-1.36d-10)) then
tmp = x - (y * (t / z))
else if (z <= 3.6d+33) then
tmp = x + (t / (a / y))
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 (z <= -5.4e+160) {
tmp = y + x;
} else if (z <= -1.36e-10) {
tmp = x - (y * (t / z));
} else if (z <= 3.6e+33) {
tmp = x + (t / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.4e+160: tmp = y + x elif z <= -1.36e-10: tmp = x - (y * (t / z)) elif z <= 3.6e+33: tmp = x + (t / (a / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.4e+160) tmp = Float64(y + x); elseif (z <= -1.36e-10) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 3.6e+33) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.4e+160) tmp = y + x; elseif (z <= -1.36e-10) tmp = x - (y * (t / z)); elseif (z <= 3.6e+33) tmp = x + (t / (a / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.4e+160], N[(y + x), $MachinePrecision], If[LessEqual[z, -1.36e-10], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+33], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+160}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -1.36 \cdot 10^{-10}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+33}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -5.4e160 or 3.6000000000000003e33 < z Initial program 70.3%
+-commutative70.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 84.6%
+-commutative84.6%
Simplified84.6%
if -5.4e160 < z < -1.36e-10Initial program 78.7%
+-commutative78.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 70.8%
+-commutative70.8%
associate-/l*79.6%
Simplified79.6%
Taylor expanded in z around 0 75.8%
neg-mul-175.8%
Simplified75.8%
Taylor expanded in y around 0 70.4%
mul-1-neg70.4%
*-commutative70.4%
associate-*r/75.8%
sub-neg75.8%
Simplified75.8%
if -1.36e-10 < z < 3.6000000000000003e33Initial program 97.4%
+-commutative97.4%
associate-/l*97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in z around 0 77.1%
+-commutative77.1%
associate-/l*76.8%
Simplified76.8%
clear-num76.7%
un-div-inv78.3%
Applied egg-rr78.3%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e+121) (not (<= z 2.45e+129))) (+ x (* y (/ z (- z a)))) (+ x (/ (* y (- z t)) (- z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e+121) || !(z <= 2.45e+129)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + ((y * (z - 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 ((z <= (-2.1d+121)) .or. (.not. (z <= 2.45d+129))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + ((y * (z - 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 ((z <= -2.1e+121) || !(z <= 2.45e+129)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + ((y * (z - t)) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e+121) or not (z <= 2.45e+129): tmp = x + (y * (z / (z - a))) else: tmp = x + ((y * (z - t)) / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e+121) || !(z <= 2.45e+129)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.1e+121) || ~((z <= 2.45e+129))) tmp = x + (y * (z / (z - a))); else tmp = x + ((y * (z - t)) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e+121], N[Not[LessEqual[z, 2.45e+129]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+121} \lor \neg \left(z \leq 2.45 \cdot 10^{+129}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\end{array}
\end{array}
if z < -2.1000000000000002e121 or 2.45e129 < z Initial program 58.4%
Taylor expanded in t around 0 59.0%
associate-/l*94.1%
Simplified94.1%
if -2.1000000000000002e121 < z < 2.45e129Initial program 96.6%
Final simplification95.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -250000000.0) (not (<= t 6.8e-78))) (+ 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 <= -250000000.0) || !(t <= 6.8e-78)) {
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 <= (-250000000.0d0)) .or. (.not. (t <= 6.8d-78))) 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 <= -250000000.0) || !(t <= 6.8e-78)) {
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 <= -250000000.0) or not (t <= 6.8e-78): 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 <= -250000000.0) || !(t <= 6.8e-78)) 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 <= -250000000.0) || ~((t <= 6.8e-78))) 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, -250000000.0], N[Not[LessEqual[t, 6.8e-78]], $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 -250000000 \lor \neg \left(t \leq 6.8 \cdot 10^{-78}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -2.5e8 or 6.80000000000000023e-78 < t Initial program 84.2%
Taylor expanded in t around inf 82.6%
mul-1-neg82.6%
associate-/l*89.5%
distribute-rgt-neg-in89.5%
distribute-frac-neg289.5%
Simplified89.5%
if -2.5e8 < t < 6.80000000000000023e-78Initial program 88.1%
Taylor expanded in t around 0 81.5%
associate-/l*92.7%
Simplified92.7%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -960000.0) (not (<= a 14000000000.0))) (+ x (* y (/ (- t z) a))) (+ x (* y (/ (- z t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -960000.0) || !(a <= 14000000000.0)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-960000.0d0)) .or. (.not. (a <= 14000000000.0d0))) then
tmp = x + (y * ((t - z) / a))
else
tmp = x + (y * ((z - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -960000.0) || !(a <= 14000000000.0)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -960000.0) or not (a <= 14000000000.0): tmp = x + (y * ((t - z) / a)) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -960000.0) || !(a <= 14000000000.0)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -960000.0) || ~((a <= 14000000000.0))) tmp = x + (y * ((t - z) / a)); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -960000.0], N[Not[LessEqual[a, 14000000000.0]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -960000 \lor \neg \left(a \leq 14000000000\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if a < -9.6e5 or 1.4e10 < a Initial program 85.2%
+-commutative85.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around inf 81.8%
mul-1-neg81.8%
unsub-neg81.8%
associate-/l*89.8%
Simplified89.8%
if -9.6e5 < a < 1.4e10Initial program 86.7%
+-commutative86.7%
associate-/l*97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in a around 0 70.2%
+-commutative70.2%
associate-/l*82.0%
Simplified82.0%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.65e-55) (not (<= z 1.5e-158))) (+ 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.65e-55) || !(z <= 1.5e-158)) {
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.65d-55)) .or. (.not. (z <= 1.5d-158))) 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.65e-55) || !(z <= 1.5e-158)) {
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.65e-55) or not (z <= 1.5e-158): 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.65e-55) || !(z <= 1.5e-158)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.65e-55) || ~((z <= 1.5e-158))) 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.65e-55], N[Not[LessEqual[z, 1.5e-158]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-55} \lor \neg \left(z \leq 1.5 \cdot 10^{-158}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.65e-55 or 1.5e-158 < z Initial program 79.0%
Taylor expanded in t around 0 65.2%
associate-/l*80.5%
Simplified80.5%
if -1.65e-55 < z < 1.5e-158Initial program 98.3%
Taylor expanded in z around 0 89.8%
Final simplification83.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e+154) (not (<= z 4.5e+32))) (+ y x) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+154) || !(z <= 4.5e+32)) {
tmp = y + x;
} else {
tmp = x + (t / (a / 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.75d+154)) .or. (.not. (z <= 4.5d+32))) then
tmp = y + x
else
tmp = x + (t / (a / 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.75e+154) || !(z <= 4.5e+32)) {
tmp = y + x;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e+154) or not (z <= 4.5e+32): tmp = y + x else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e+154) || !(z <= 4.5e+32)) tmp = Float64(y + x); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.75e+154) || ~((z <= 4.5e+32))) tmp = y + x; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e+154], N[Not[LessEqual[z, 4.5e+32]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+154} \lor \neg \left(z \leq 4.5 \cdot 10^{+32}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.7500000000000001e154 or 4.5000000000000003e32 < z Initial program 69.4%
+-commutative69.4%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 84.7%
+-commutative84.7%
Simplified84.7%
if -1.7500000000000001e154 < z < 4.5000000000000003e32Initial program 94.1%
+-commutative94.1%
associate-/l*98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in z around 0 72.4%
+-commutative72.4%
associate-/l*73.9%
Simplified73.9%
clear-num73.8%
un-div-inv75.1%
Applied egg-rr75.1%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e+154) (not (<= z 1.3e+34))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+154) || !(z <= 1.3e+34)) {
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.75d+154)) .or. (.not. (z <= 1.3d+34))) 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.75e+154) || !(z <= 1.3e+34)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e+154) or not (z <= 1.3e+34): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e+154) || !(z <= 1.3e+34)) 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.75e+154) || ~((z <= 1.3e+34))) 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.75e+154], N[Not[LessEqual[z, 1.3e+34]], $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.75 \cdot 10^{+154} \lor \neg \left(z \leq 1.3 \cdot 10^{+34}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.7500000000000001e154 or 1.29999999999999999e34 < z Initial program 69.4%
+-commutative69.4%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 84.7%
+-commutative84.7%
Simplified84.7%
if -1.7500000000000001e154 < z < 1.29999999999999999e34Initial program 94.1%
+-commutative94.1%
associate-/l*98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in z around 0 72.4%
+-commutative72.4%
associate-/l*73.9%
Simplified73.9%
*-commutative73.9%
associate-*l/72.4%
Applied egg-rr72.4%
associate-/l*74.5%
Applied egg-rr74.5%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.3e-55) (not (<= z 3.3e+33))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.3e-55) || !(z <= 3.3e+33)) {
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 <= (-3.3d-55)) .or. (.not. (z <= 3.3d+33))) 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 <= -3.3e-55) || !(z <= 3.3e+33)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.3e-55) or not (z <= 3.3e+33): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.3e-55) || !(z <= 3.3e+33)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.3e-55) || ~((z <= 3.3e+33))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.3e-55], N[Not[LessEqual[z, 3.3e+33]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-55} \lor \neg \left(z \leq 3.3 \cdot 10^{+33}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -3.2999999999999999e-55 or 3.29999999999999976e33 < z Initial program 73.4%
+-commutative73.4%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -3.2999999999999999e-55 < z < 3.29999999999999976e33Initial program 98.0%
Taylor expanded in z around 0 78.4%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3e-55) (not (<= z 1.5e+72))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3e-55) || !(z <= 1.5e+72)) {
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 <= (-3d-55)) .or. (.not. (z <= 1.5d+72))) 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 <= -3e-55) || !(z <= 1.5e+72)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3e-55) or not (z <= 1.5e+72): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3e-55) || !(z <= 1.5e+72)) 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 <= -3e-55) || ~((z <= 1.5e+72))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3e-55], N[Not[LessEqual[z, 1.5e+72]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-55} \lor \neg \left(z \leq 1.5 \cdot 10^{+72}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.00000000000000016e-55 or 1.50000000000000001e72 < z Initial program 71.3%
+-commutative71.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.1%
+-commutative78.1%
Simplified78.1%
if -3.00000000000000016e-55 < z < 1.50000000000000001e72Initial program 98.1%
+-commutative98.1%
associate-/l*97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in y around 0 47.5%
Final simplification61.3%
(FPCore (x y z t a) :precision binary64 (- x (/ (/ (- t z) (- z a)) (/ 1.0 y))))
double code(double x, double y, double z, double t, double a) {
return x - (((t - z) / (z - a)) / (1.0 / y));
}
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 - (((t - z) / (z - a)) / (1.0d0 / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((t - z) / (z - a)) / (1.0 / y));
}
def code(x, y, z, t, a): return x - (((t - z) / (z - a)) / (1.0 / y))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(t - z) / Float64(z - a)) / Float64(1.0 / y))) end
function tmp = code(x, y, z, t, a) tmp = x - (((t - z) / (z - a)) / (1.0 / y)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(t - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] / N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{\frac{t - z}{z - a}}{\frac{1}{y}}
\end{array}
Initial program 86.0%
+-commutative86.0%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
fma-undefine98.8%
associate-/l*86.0%
div-inv85.9%
*-commutative85.9%
associate-*r*96.5%
div-inv96.6%
Applied egg-rr96.6%
clear-num96.2%
div-inv96.7%
div-inv96.6%
associate-/r*98.7%
Applied egg-rr98.7%
Final simplification98.7%
(FPCore (x y z t a) :precision binary64 (+ x (/ (- z t) (/ (- z a) y))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / ((z - a) / y));
}
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) / ((z - a) / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / ((z - a) / y));
}
def code(x, y, z, t, a): return x + ((z - t) / ((z - a) / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) / ((z - a) / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{\frac{z - a}{y}}
\end{array}
Initial program 86.0%
+-commutative86.0%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
fma-undefine98.8%
associate-/l*86.0%
div-inv85.9%
*-commutative85.9%
associate-*r*96.5%
div-inv96.6%
Applied egg-rr96.6%
clear-num96.2%
div-inv96.7%
Applied egg-rr96.7%
Final simplification96.7%
(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 86.0%
+-commutative86.0%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
fma-undefine98.8%
associate-/l*86.0%
div-inv85.9%
*-commutative85.9%
associate-*r*96.5%
div-inv96.6%
Applied egg-rr96.6%
Final simplification96.6%
(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 86.0%
+-commutative86.0%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in y around 0 50.4%
(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 2024170
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))