
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 98.8%
clear-num98.8%
un-div-inv98.8%
Applied egg-rr98.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -8.5e+106)
(+ x (/ y (/ a (- z t))))
(if (<= a -1.3e-219)
(+ x (/ (* y z) (- a t)))
(if (<= a 32.0) (- x (* y (+ (/ z t) -1.0))) (+ x (* y (/ (- z t) a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.5e+106) {
tmp = x + (y / (a / (z - t)));
} else if (a <= -1.3e-219) {
tmp = x + ((y * z) / (a - t));
} else if (a <= 32.0) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x + (y * ((z - 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 <= (-8.5d+106)) then
tmp = x + (y / (a / (z - t)))
else if (a <= (-1.3d-219)) then
tmp = x + ((y * z) / (a - t))
else if (a <= 32.0d0) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else
tmp = x + (y * ((z - 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 <= -8.5e+106) {
tmp = x + (y / (a / (z - t)));
} else if (a <= -1.3e-219) {
tmp = x + ((y * z) / (a - t));
} else if (a <= 32.0) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.5e+106: tmp = x + (y / (a / (z - t))) elif a <= -1.3e-219: tmp = x + ((y * z) / (a - t)) elif a <= 32.0: tmp = x - (y * ((z / t) + -1.0)) else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.5e+106) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); elseif (a <= -1.3e-219) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); elseif (a <= 32.0) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8.5e+106) tmp = x + (y / (a / (z - t))); elseif (a <= -1.3e-219) tmp = x + ((y * z) / (a - t)); elseif (a <= 32.0) tmp = x - (y * ((z / t) + -1.0)); else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.5e+106], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.3e-219], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 32.0], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{+106}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{-219}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{elif}\;a \leq 32:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if a < -8.4999999999999992e106Initial program 99.8%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 94.7%
if -8.4999999999999992e106 < a < -1.30000000000000001e-219Initial program 98.4%
Taylor expanded in z around inf 85.9%
if -1.30000000000000001e-219 < a < 32Initial program 97.3%
Taylor expanded in a around 0 73.1%
mul-1-neg73.1%
unsub-neg73.1%
associate-/l*90.4%
div-sub90.4%
sub-neg90.4%
*-inverses90.4%
metadata-eval90.4%
Simplified90.4%
if 32 < a Initial program 99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in a around inf 77.4%
+-commutative77.4%
associate-/l*90.6%
Simplified90.6%
Final simplification90.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.2e+171)
(+ x y)
(if (<= t -1.05e-230)
(+ x (/ (* y z) (- a t)))
(if (<= t 5.5e+124) (+ x (/ y (/ a (- z t)))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+171) {
tmp = x + y;
} else if (t <= -1.05e-230) {
tmp = x + ((y * z) / (a - t));
} else if (t <= 5.5e+124) {
tmp = x + (y / (a / (z - 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 <= (-4.2d+171)) then
tmp = x + y
else if (t <= (-1.05d-230)) then
tmp = x + ((y * z) / (a - t))
else if (t <= 5.5d+124) then
tmp = x + (y / (a / (z - 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 <= -4.2e+171) {
tmp = x + y;
} else if (t <= -1.05e-230) {
tmp = x + ((y * z) / (a - t));
} else if (t <= 5.5e+124) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.2e+171: tmp = x + y elif t <= -1.05e-230: tmp = x + ((y * z) / (a - t)) elif t <= 5.5e+124: tmp = x + (y / (a / (z - t))) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e+171) tmp = Float64(x + y); elseif (t <= -1.05e-230) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); elseif (t <= 5.5e+124) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.2e+171) tmp = x + y; elseif (t <= -1.05e-230) tmp = x + ((y * z) / (a - t)); elseif (t <= 5.5e+124) tmp = x + (y / (a / (z - t))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e+171], N[(x + y), $MachinePrecision], If[LessEqual[t, -1.05e-230], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e+124], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+171}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1.05 \cdot 10^{-230}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+124}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.2000000000000003e171 or 5.49999999999999977e124 < t Initial program 99.9%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -4.2000000000000003e171 < t < -1.0499999999999999e-230Initial program 97.5%
Taylor expanded in z around inf 84.7%
if -1.0499999999999999e-230 < t < 5.49999999999999977e124Initial program 99.0%
clear-num99.0%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in a around inf 82.2%
Final simplification84.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ a (- z t))))))
(if (<= a -5.2e-48)
t_1
(if (<= a -4.05e-299) (- x (/ (* y z) t)) (if (<= a 5.2) (+ x y) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (a / (z - t)));
double tmp;
if (a <= -5.2e-48) {
tmp = t_1;
} else if (a <= -4.05e-299) {
tmp = x - ((y * z) / t);
} else if (a <= 5.2) {
tmp = x + y;
} 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 / (a / (z - t)))
if (a <= (-5.2d-48)) then
tmp = t_1
else if (a <= (-4.05d-299)) then
tmp = x - ((y * z) / t)
else if (a <= 5.2d0) then
tmp = x + y
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 / (a / (z - t)));
double tmp;
if (a <= -5.2e-48) {
tmp = t_1;
} else if (a <= -4.05e-299) {
tmp = x - ((y * z) / t);
} else if (a <= 5.2) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / (a / (z - t))) tmp = 0 if a <= -5.2e-48: tmp = t_1 elif a <= -4.05e-299: tmp = x - ((y * z) / t) elif a <= 5.2: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(a / Float64(z - t)))) tmp = 0.0 if (a <= -5.2e-48) tmp = t_1; elseif (a <= -4.05e-299) tmp = Float64(x - Float64(Float64(y * z) / t)); elseif (a <= 5.2) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / (a / (z - t))); tmp = 0.0; if (a <= -5.2e-48) tmp = t_1; elseif (a <= -4.05e-299) tmp = x - ((y * z) / t); elseif (a <= 5.2) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.2e-48], t$95$1, If[LessEqual[a, -4.05e-299], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2], N[(x + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{if}\;a \leq -5.2 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -4.05 \cdot 10^{-299}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{elif}\;a \leq 5.2:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.19999999999999975e-48 or 5.20000000000000018 < a Initial program 99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 89.7%
if -5.19999999999999975e-48 < a < -4.0499999999999998e-299Initial program 96.3%
Taylor expanded in a around 0 79.0%
mul-1-neg79.0%
unsub-neg79.0%
associate-/l*84.6%
div-sub84.6%
sub-neg84.6%
*-inverses84.6%
metadata-eval84.6%
Simplified84.6%
Taylor expanded in z around inf 69.6%
if -4.0499999999999998e-299 < a < 5.20000000000000018Initial program 98.2%
Taylor expanded in t around inf 70.4%
+-commutative70.4%
Simplified70.4%
Final simplification81.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.2e+171)
(+ x y)
(if (<= t -1.7e+20)
(- x (* y (/ z t)))
(if (<= t 3.3e+124) (+ x (/ y (/ a z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.2e+171) {
tmp = x + y;
} else if (t <= -1.7e+20) {
tmp = x - (y * (z / t));
} else if (t <= 3.3e+124) {
tmp = x + (y / (a / 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 (t <= (-2.2d+171)) then
tmp = x + y
else if (t <= (-1.7d+20)) then
tmp = x - (y * (z / t))
else if (t <= 3.3d+124) then
tmp = x + (y / (a / 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 (t <= -2.2e+171) {
tmp = x + y;
} else if (t <= -1.7e+20) {
tmp = x - (y * (z / t));
} else if (t <= 3.3e+124) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.2e+171: tmp = x + y elif t <= -1.7e+20: tmp = x - (y * (z / t)) elif t <= 3.3e+124: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.2e+171) tmp = Float64(x + y); elseif (t <= -1.7e+20) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 3.3e+124) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.2e+171) tmp = x + y; elseif (t <= -1.7e+20) tmp = x - (y * (z / t)); elseif (t <= 3.3e+124) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.2e+171], N[(x + y), $MachinePrecision], If[LessEqual[t, -1.7e+20], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e+124], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+171}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{+20}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+124}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.1999999999999999e171 or 3.30000000000000015e124 < t Initial program 99.9%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -2.1999999999999999e171 < t < -1.7e20Initial program 99.9%
Taylor expanded in z around inf 79.8%
Taylor expanded in a around 0 75.8%
mul-1-neg75.8%
associate-*r/79.2%
unsub-neg79.2%
Simplified79.2%
if -1.7e20 < t < 3.30000000000000015e124Initial program 98.1%
clear-num98.1%
un-div-inv98.1%
Applied egg-rr98.1%
Taylor expanded in t around 0 75.5%
Final simplification78.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.5e+93) (not (<= t 3.3e+124))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.5e+93) || !(t <= 3.3e+124)) {
tmp = x + y;
} else {
tmp = x + (y / (a / 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 ((t <= (-4.5d+93)) .or. (.not. (t <= 3.3d+124))) then
tmp = x + y
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.5e+93) || !(t <= 3.3e+124)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.5e+93) or not (t <= 3.3e+124): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.5e+93) || !(t <= 3.3e+124)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.5e+93) || ~((t <= 3.3e+124))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.5e+93], N[Not[LessEqual[t, 3.3e+124]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+93} \lor \neg \left(t \leq 3.3 \cdot 10^{+124}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.49999999999999991e93 or 3.30000000000000015e124 < t Initial program 99.9%
Taylor expanded in t around inf 83.7%
+-commutative83.7%
Simplified83.7%
if -4.49999999999999991e93 < t < 3.30000000000000015e124Initial program 98.3%
clear-num98.2%
un-div-inv98.3%
Applied egg-rr98.3%
Taylor expanded in t around 0 73.7%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.4e+109) x (if (<= a 2.45e+136) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.4e+109) {
tmp = x;
} else if (a <= 2.45e+136) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-4.4d+109)) then
tmp = x
else if (a <= 2.45d+136) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.4e+109) {
tmp = x;
} else if (a <= 2.45e+136) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.4e+109: tmp = x elif a <= 2.45e+136: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.4e+109) tmp = x; elseif (a <= 2.45e+136) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.4e+109) tmp = x; elseif (a <= 2.45e+136) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.4e+109], x, If[LessEqual[a, 2.45e+136], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.4 \cdot 10^{+109}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.45 \cdot 10^{+136}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.3999999999999998e109 or 2.45000000000000006e136 < a Initial program 99.9%
Taylor expanded in x around inf 65.3%
if -4.3999999999999998e109 < a < 2.45000000000000006e136Initial program 98.1%
Taylor expanded in t around inf 63.1%
+-commutative63.1%
Simplified63.1%
Final simplification63.9%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 98.8%
(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.8%
Taylor expanded in x around inf 51.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} 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 - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
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 - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024086
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))