
(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
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -10.0)
(- x (/ (* y t) (- z a)))
(if (<= t_1 2e-8)
(- x (/ y (/ a (- z t))))
(if (<= t_1 1.00000000000005)
(+ x (* y (/ (- z t) z)))
(- x (* y (/ t (- z a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -10.0) {
tmp = x - ((y * t) / (z - a));
} else if (t_1 <= 2e-8) {
tmp = x - (y / (a / (z - t)));
} else if (t_1 <= 1.00000000000005) {
tmp = x + (y * ((z - t) / z));
} 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) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= (-10.0d0)) then
tmp = x - ((y * t) / (z - a))
else if (t_1 <= 2d-8) then
tmp = x - (y / (a / (z - t)))
else if (t_1 <= 1.00000000000005d0) then
tmp = x + (y * ((z - t) / z))
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 t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -10.0) {
tmp = x - ((y * t) / (z - a));
} else if (t_1 <= 2e-8) {
tmp = x - (y / (a / (z - t)));
} else if (t_1 <= 1.00000000000005) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -10.0: tmp = x - ((y * t) / (z - a)) elif t_1 <= 2e-8: tmp = x - (y / (a / (z - t))) elif t_1 <= 1.00000000000005: tmp = x + (y * ((z - t) / z)) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -10.0) tmp = Float64(x - Float64(Float64(y * t) / Float64(z - a))); elseif (t_1 <= 2e-8) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); elseif (t_1 <= 1.00000000000005) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -10.0) tmp = x - ((y * t) / (z - a)); elseif (t_1 <= 2e-8) tmp = x - (y / (a / (z - t))); elseif (t_1 <= 1.00000000000005) tmp = x + (y * ((z - t) / z)); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -10.0], N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-8], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.00000000000005], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -10:\\
\;\;\;\;x - \frac{y \cdot t}{z - a}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-8}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;t_1 \leq 1.00000000000005:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -10Initial program 91.4%
associate-*r/93.5%
clear-num93.5%
Applied egg-rr93.5%
*-un-lft-identity93.5%
times-frac91.1%
Applied egg-rr91.1%
Taylor expanded in t around inf 91.9%
associate-*r/91.9%
mul-1-neg91.9%
*-commutative91.9%
Simplified91.9%
if -10 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e-8Initial program 99.8%
Taylor expanded in a around inf 87.6%
mul-1-neg87.6%
unsub-neg87.6%
associate-/l*99.9%
Simplified99.9%
if 2e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000004996Initial program 100.0%
Taylor expanded in a around 0 100.0%
if 1.00000000000004996 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 99.8%
Taylor expanded in t around inf 99.8%
neg-mul-199.8%
distribute-neg-frac99.8%
Simplified99.8%
Final simplification98.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -4e+188)
(+ x (/ (* y t) a))
(if (<= t_1 -10.0)
(- x (/ t (/ z y)))
(if (<= t_1 -2e-155)
(- x (/ y (/ a z)))
(if (<= t_1 2e-26)
(- x (/ y (/ (- a) t)))
(if (<= t_1 4e+49) (+ x y) (* y t_1))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -4e+188) {
tmp = x + ((y * t) / a);
} else if (t_1 <= -10.0) {
tmp = x - (t / (z / y));
} else if (t_1 <= -2e-155) {
tmp = x - (y / (a / z));
} else if (t_1 <= 2e-26) {
tmp = x - (y / (-a / t));
} else if (t_1 <= 4e+49) {
tmp = x + y;
} else {
tmp = y * 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 = (z - t) / (z - a)
if (t_1 <= (-4d+188)) then
tmp = x + ((y * t) / a)
else if (t_1 <= (-10.0d0)) then
tmp = x - (t / (z / y))
else if (t_1 <= (-2d-155)) then
tmp = x - (y / (a / z))
else if (t_1 <= 2d-26) then
tmp = x - (y / (-a / t))
else if (t_1 <= 4d+49) then
tmp = x + y
else
tmp = y * 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 = (z - t) / (z - a);
double tmp;
if (t_1 <= -4e+188) {
tmp = x + ((y * t) / a);
} else if (t_1 <= -10.0) {
tmp = x - (t / (z / y));
} else if (t_1 <= -2e-155) {
tmp = x - (y / (a / z));
} else if (t_1 <= 2e-26) {
tmp = x - (y / (-a / t));
} else if (t_1 <= 4e+49) {
tmp = x + y;
} else {
tmp = y * t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -4e+188: tmp = x + ((y * t) / a) elif t_1 <= -10.0: tmp = x - (t / (z / y)) elif t_1 <= -2e-155: tmp = x - (y / (a / z)) elif t_1 <= 2e-26: tmp = x - (y / (-a / t)) elif t_1 <= 4e+49: tmp = x + y else: tmp = y * t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -4e+188) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (t_1 <= -10.0) tmp = Float64(x - Float64(t / Float64(z / y))); elseif (t_1 <= -2e-155) tmp = Float64(x - Float64(y / Float64(a / z))); elseif (t_1 <= 2e-26) tmp = Float64(x - Float64(y / Float64(Float64(-a) / t))); elseif (t_1 <= 4e+49) tmp = Float64(x + y); else tmp = Float64(y * t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -4e+188) tmp = x + ((y * t) / a); elseif (t_1 <= -10.0) tmp = x - (t / (z / y)); elseif (t_1 <= -2e-155) tmp = x - (y / (a / z)); elseif (t_1 <= 2e-26) tmp = x - (y / (-a / t)); elseif (t_1 <= 4e+49) tmp = x + y; else tmp = y * t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+188], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -10.0], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-155], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-26], N[(x - N[(y / N[((-a) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+49], N[(x + y), $MachinePrecision], N[(y * t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+188}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;t_1 \leq -10:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-155}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-26}:\\
\;\;\;\;x - \frac{y}{\frac{-a}{t}}\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+49}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot t_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -4.0000000000000001e188Initial program 80.8%
Taylor expanded in z around 0 80.6%
if -4.0000000000000001e188 < (/.f64 (-.f64 z t) (-.f64 z a)) < -10Initial program 99.9%
Taylor expanded in a around 0 74.2%
+-commutative74.2%
associate-/l*74.1%
Simplified74.1%
Taylor expanded in z around 0 73.4%
mul-1-neg73.4%
associate-/l*77.3%
Simplified77.3%
if -10 < (/.f64 (-.f64 z t) (-.f64 z a)) < -2.00000000000000003e-155Initial program 99.9%
Taylor expanded in a around inf 93.2%
mul-1-neg93.2%
unsub-neg93.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 88.6%
if -2.00000000000000003e-155 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-26Initial program 99.8%
Taylor expanded in a around inf 84.2%
mul-1-neg84.2%
unsub-neg84.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 83.3%
associate-*r/83.3%
neg-mul-183.3%
Simplified83.3%
if 2.0000000000000001e-26 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999979e49Initial program 100.0%
Taylor expanded in z around inf 99.0%
+-commutative99.0%
Simplified99.0%
if 3.99999999999999979e49 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 99.8%
associate-*r/88.7%
clear-num88.8%
Applied egg-rr88.8%
*-un-lft-identity88.8%
times-frac99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 88.2%
div-sub88.2%
Simplified88.2%
Final simplification89.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -2e+224)
(+ x (/ 1.0 (/ a (* y t))))
(if (<= t_1 -10.0)
(+ x (/ (* y (- z t)) z))
(if (<= t_1 2e-26)
(- x (/ y (/ a (- z t))))
(if (<= t_1 4e+49) (+ x (* y (/ z (- z a)))) (* y t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -2e+224) {
tmp = x + (1.0 / (a / (y * t)));
} else if (t_1 <= -10.0) {
tmp = x + ((y * (z - t)) / z);
} else if (t_1 <= 2e-26) {
tmp = x - (y / (a / (z - t)));
} else if (t_1 <= 4e+49) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = y * 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 = (z - t) / (z - a)
if (t_1 <= (-2d+224)) then
tmp = x + (1.0d0 / (a / (y * t)))
else if (t_1 <= (-10.0d0)) then
tmp = x + ((y * (z - t)) / z)
else if (t_1 <= 2d-26) then
tmp = x - (y / (a / (z - t)))
else if (t_1 <= 4d+49) then
tmp = x + (y * (z / (z - a)))
else
tmp = y * 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 = (z - t) / (z - a);
double tmp;
if (t_1 <= -2e+224) {
tmp = x + (1.0 / (a / (y * t)));
} else if (t_1 <= -10.0) {
tmp = x + ((y * (z - t)) / z);
} else if (t_1 <= 2e-26) {
tmp = x - (y / (a / (z - t)));
} else if (t_1 <= 4e+49) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = y * t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -2e+224: tmp = x + (1.0 / (a / (y * t))) elif t_1 <= -10.0: tmp = x + ((y * (z - t)) / z) elif t_1 <= 2e-26: tmp = x - (y / (a / (z - t))) elif t_1 <= 4e+49: tmp = x + (y * (z / (z - a))) else: tmp = y * t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -2e+224) tmp = Float64(x + Float64(1.0 / Float64(a / Float64(y * t)))); elseif (t_1 <= -10.0) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / z)); elseif (t_1 <= 2e-26) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); elseif (t_1 <= 4e+49) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(y * t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -2e+224) tmp = x + (1.0 / (a / (y * t))); elseif (t_1 <= -10.0) tmp = x + ((y * (z - t)) / z); elseif (t_1 <= 2e-26) tmp = x - (y / (a / (z - t))); elseif (t_1 <= 4e+49) tmp = x + (y * (z / (z - a))); else tmp = y * t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+224], N[(x + N[(1.0 / N[(a / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -10.0], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-26], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+49], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+224}:\\
\;\;\;\;x + \frac{1}{\frac{a}{y \cdot t}}\\
\mathbf{elif}\;t_1 \leq -10:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-26}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+49}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot t_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1.99999999999999994e224Initial program 74.5%
Taylor expanded in z around 0 86.9%
+-commutative86.9%
associate-/l*86.8%
Simplified86.8%
clear-num86.9%
inv-pow86.9%
Applied egg-rr86.9%
unpow-186.9%
associate-/l/87.0%
Simplified87.0%
if -1.99999999999999994e224 < (/.f64 (-.f64 z t) (-.f64 z a)) < -10Initial program 99.9%
Taylor expanded in a around 0 75.2%
if -10 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-26Initial program 99.8%
Taylor expanded in a around inf 87.3%
mul-1-neg87.3%
unsub-neg87.3%
associate-/l*99.8%
Simplified99.8%
if 2.0000000000000001e-26 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999979e49Initial program 100.0%
Taylor expanded in t around 0 99.0%
if 3.99999999999999979e49 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 99.8%
associate-*r/88.7%
clear-num88.8%
Applied egg-rr88.8%
*-un-lft-identity88.8%
times-frac99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 88.2%
div-sub88.2%
Simplified88.2%
Final simplification94.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (- x (* y (/ t (- z a))))))
(if (<= t_1 -10.0)
t_2
(if (<= t_1 2e-8)
(- x (/ y (/ a (- z t))))
(if (<= t_1 1.00000000000005) (+ x (* y (/ (- z t) z))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = x - (y * (t / (z - a)));
double tmp;
if (t_1 <= -10.0) {
tmp = t_2;
} else if (t_1 <= 2e-8) {
tmp = x - (y / (a / (z - t)));
} else if (t_1 <= 1.00000000000005) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (z - t) / (z - a)
t_2 = x - (y * (t / (z - a)))
if (t_1 <= (-10.0d0)) then
tmp = t_2
else if (t_1 <= 2d-8) then
tmp = x - (y / (a / (z - t)))
else if (t_1 <= 1.00000000000005d0) then
tmp = x + (y * ((z - t) / z))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = x - (y * (t / (z - a)));
double tmp;
if (t_1 <= -10.0) {
tmp = t_2;
} else if (t_1 <= 2e-8) {
tmp = x - (y / (a / (z - t)));
} else if (t_1 <= 1.00000000000005) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = x - (y * (t / (z - a))) tmp = 0 if t_1 <= -10.0: tmp = t_2 elif t_1 <= 2e-8: tmp = x - (y / (a / (z - t))) elif t_1 <= 1.00000000000005: tmp = x + (y * ((z - t) / z)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(x - Float64(y * Float64(t / Float64(z - a)))) tmp = 0.0 if (t_1 <= -10.0) tmp = t_2; elseif (t_1 <= 2e-8) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); elseif (t_1 <= 1.00000000000005) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = x - (y * (t / (z - a))); tmp = 0.0; if (t_1 <= -10.0) tmp = t_2; elseif (t_1 <= 2e-8) tmp = x - (y / (a / (z - t))); elseif (t_1 <= 1.00000000000005) tmp = x + (y * ((z - t) / z)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -10.0], t$95$2, If[LessEqual[t$95$1, 2e-8], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.00000000000005], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x - y \cdot \frac{t}{z - a}\\
\mathbf{if}\;t_1 \leq -10:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-8}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;t_1 \leq 1.00000000000005:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -10 or 1.00000000000004996 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.9%
Taylor expanded in t around inf 94.0%
neg-mul-194.0%
distribute-neg-frac94.0%
Simplified94.0%
if -10 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e-8Initial program 99.8%
Taylor expanded in a around inf 87.6%
mul-1-neg87.6%
unsub-neg87.6%
associate-/l*99.9%
Simplified99.9%
if 2e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000004996Initial program 100.0%
Taylor expanded in a around 0 100.0%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- z t) (- z a)))))
(if (or (<= t_1 -1e+187) (not (<= t_1 1e+155)))
t_1
(+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (z - a));
double tmp;
if ((t_1 <= -1e+187) || !(t_1 <= 1e+155)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * ((z - t) / (z - a))
if ((t_1 <= (-1d+187)) .or. (.not. (t_1 <= 1d+155))) then
tmp = t_1
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 t_1 = y * ((z - t) / (z - a));
double tmp;
if ((t_1 <= -1e+187) || !(t_1 <= 1e+155)) {
tmp = t_1;
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (z - a)) tmp = 0 if (t_1 <= -1e+187) or not (t_1 <= 1e+155): tmp = t_1 else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(z - a))) tmp = 0.0 if ((t_1 <= -1e+187) || !(t_1 <= 1e+155)) tmp = t_1; else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (z - a)); tmp = 0.0; if ((t_1 <= -1e+187) || ~((t_1 <= 1e+155))) tmp = t_1; else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+187], N[Not[LessEqual[t$95$1, 1e+155]], $MachinePrecision]], t$95$1, N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+187} \lor \neg \left(t_1 \leq 10^{+155}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < -9.99999999999999907e186 or 1.00000000000000001e155 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) Initial program 94.6%
associate-*r/64.3%
clear-num64.2%
Applied egg-rr64.2%
*-un-lft-identity64.2%
times-frac94.3%
Applied egg-rr94.3%
Taylor expanded in y around inf 86.7%
div-sub86.7%
Simplified86.7%
if -9.99999999999999907e186 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < 1.00000000000000001e155Initial program 99.9%
Taylor expanded in t around 0 86.4%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -5e+48) (+ x y) (if (<= z 1.4e+66) (+ x (* t (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e+48) {
tmp = x + y;
} else if (z <= 1.4e+66) {
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 <= (-5d+48)) then
tmp = x + y
else if (z <= 1.4d+66) 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 <= -5e+48) {
tmp = x + y;
} else if (z <= 1.4e+66) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5e+48: tmp = x + y elif z <= 1.4e+66: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e+48) tmp = Float64(x + y); elseif (z <= 1.4e+66) 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 <= -5e+48) tmp = x + y; elseif (z <= 1.4e+66) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e+48], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.4e+66], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+48}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+66}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.99999999999999973e48 or 1.4e66 < z Initial program 99.9%
Taylor expanded in z around inf 80.6%
+-commutative80.6%
Simplified80.6%
if -4.99999999999999973e48 < z < 1.4e66Initial program 97.3%
associate-*r/94.2%
clear-num94.1%
Applied egg-rr94.1%
Taylor expanded in z around 0 71.3%
associate-*r/74.3%
Simplified74.3%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.48e+209) (* y (/ t a)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.48e+209) {
tmp = 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 (t <= (-1.48d+209)) then
tmp = 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 (t <= -1.48e+209) {
tmp = y * (t / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.48e+209: tmp = y * (t / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.48e+209) tmp = 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 (t <= -1.48e+209) tmp = y * (t / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.48e+209], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.48 \cdot 10^{+209}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.47999999999999995e209Initial program 95.7%
Taylor expanded in a around inf 53.9%
mul-1-neg53.9%
unsub-neg53.9%
associate-/l*64.2%
Simplified64.2%
Taylor expanded in y around inf 51.0%
Taylor expanded in t around inf 55.4%
if -1.47999999999999995e209 < t Initial program 98.7%
Taylor expanded in z around inf 66.0%
+-commutative66.0%
Simplified66.0%
Final simplification65.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.15e+209) (/ y (/ a t)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.15e+209) {
tmp = 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 (t <= (-2.15d+209)) then
tmp = 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 (t <= -2.15e+209) {
tmp = y / (a / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.15e+209: tmp = y / (a / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.15e+209) tmp = 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 (t <= -2.15e+209) tmp = y / (a / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.15e+209], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+209}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.14999999999999994e209Initial program 95.7%
Taylor expanded in a around inf 53.9%
mul-1-neg53.9%
unsub-neg53.9%
associate-/l*64.2%
Simplified64.2%
Taylor expanded in y around inf 51.0%
Taylor expanded in t around inf 55.4%
clear-num55.4%
add-sqr-sqrt25.2%
sqrt-unprod23.4%
sqr-neg23.4%
sqrt-unprod0.6%
add-sqr-sqrt1.7%
div-inv1.7%
add-sqr-sqrt0.6%
sqrt-unprod23.4%
sqr-neg23.4%
sqrt-unprod25.2%
add-sqr-sqrt55.5%
Applied egg-rr55.5%
if -2.14999999999999994e209 < t Initial program 98.7%
Taylor expanded in z around inf 66.0%
+-commutative66.0%
Simplified66.0%
Final simplification65.0%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + 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 + y
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 98.4%
Taylor expanded in z around inf 61.5%
+-commutative61.5%
Simplified61.5%
Final simplification61.5%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.4%
Taylor expanded in x around inf 49.3%
Final simplification49.3%
(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 2023271
(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)))))