
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{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 85.5%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.2%
Applied egg-rr97.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.7e+151)
(+ x y)
(if (<= t -6.8e-90)
(- x (/ t (/ a y)))
(if (<= t 1.9e+72) (+ x (/ y (/ a z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7e+151) {
tmp = x + y;
} else if (t <= -6.8e-90) {
tmp = x - (t / (a / y));
} else if (t <= 1.9e+72) {
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.7d+151)) then
tmp = x + y
else if (t <= (-6.8d-90)) then
tmp = x - (t / (a / y))
else if (t <= 1.9d+72) 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.7e+151) {
tmp = x + y;
} else if (t <= -6.8e-90) {
tmp = x - (t / (a / y));
} else if (t <= 1.9e+72) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.7e+151: tmp = x + y elif t <= -6.8e-90: tmp = x - (t / (a / y)) elif t <= 1.9e+72: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.7e+151) tmp = Float64(x + y); elseif (t <= -6.8e-90) tmp = Float64(x - Float64(t / Float64(a / y))); elseif (t <= 1.9e+72) 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.7e+151) tmp = x + y; elseif (t <= -6.8e-90) tmp = x - (t / (a / y)); elseif (t <= 1.9e+72) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7e+151], N[(x + y), $MachinePrecision], If[LessEqual[t, -6.8e-90], N[(x - N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+72], 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.7 \cdot 10^{+151}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -6.8 \cdot 10^{-90}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+72}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.7000000000000001e151 or 1.90000000000000003e72 < t Initial program 70.2%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6494.3%
Simplified94.3%
if -2.7000000000000001e151 < t < -6.79999999999999988e-90Initial program 85.9%
Taylor expanded in a around inf
Simplified64.9%
Taylor expanded in z around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6469.8%
Simplified69.8%
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6480.7%
Applied egg-rr80.7%
if -6.79999999999999988e-90 < t < 1.90000000000000003e72Initial program 94.9%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.0%
Applied egg-rr96.0%
Taylor expanded in t around 0
/-lowering-/.f6481.3%
Simplified81.3%
Final simplification85.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.95e-47)
(+ x (* y (/ t (- t a))))
(if (<= t 1.45e+84)
(+ x (/ (* y z) (- a t)))
(- x (* y (+ -1.0 (/ z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.95e-47) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 1.45e+84) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x - (y * (-1.0 + (z / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.95d-47)) then
tmp = x + (y * (t / (t - a)))
else if (t <= 1.45d+84) then
tmp = x + ((y * z) / (a - t))
else
tmp = x - (y * ((-1.0d0) + (z / t)))
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.95e-47) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 1.45e+84) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x - (y * (-1.0 + (z / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.95e-47: tmp = x + (y * (t / (t - a))) elif t <= 1.45e+84: tmp = x + ((y * z) / (a - t)) else: tmp = x - (y * (-1.0 + (z / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.95e-47) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); elseif (t <= 1.45e+84) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x - Float64(y * Float64(-1.0 + Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.95e-47) tmp = x + (y * (t / (t - a))); elseif (t <= 1.45e+84) tmp = x + ((y * z) / (a - t)); else tmp = x - (y * (-1.0 + (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.95e-47], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.45e+84], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(-1.0 + N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-47}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{+84}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(-1 + \frac{z}{t}\right)\\
\end{array}
\end{array}
if t < -1.94999999999999989e-47Initial program 76.9%
Taylor expanded in z around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6494.5%
Simplified94.5%
if -1.94999999999999989e-47 < t < 1.44999999999999994e84Initial program 95.2%
Taylor expanded in z around inf
*-lowering-*.f6488.9%
Simplified88.9%
if 1.44999999999999994e84 < t Initial program 69.5%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64100.0%
Simplified100.0%
Final simplification92.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* y (+ -1.0 (/ z t)))))) (if (<= t -5.8e+134) t_1 (if (<= t 1e+76) (+ x (/ (* y z) (- a t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (-1.0 + (z / t)));
double tmp;
if (t <= -5.8e+134) {
tmp = t_1;
} else if (t <= 1e+76) {
tmp = x + ((y * z) / (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 * ((-1.0d0) + (z / t)))
if (t <= (-5.8d+134)) then
tmp = t_1
else if (t <= 1d+76) then
tmp = x + ((y * z) / (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 * (-1.0 + (z / t)));
double tmp;
if (t <= -5.8e+134) {
tmp = t_1;
} else if (t <= 1e+76) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * (-1.0 + (z / t))) tmp = 0 if t <= -5.8e+134: tmp = t_1 elif t <= 1e+76: tmp = x + ((y * z) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(-1.0 + Float64(z / t)))) tmp = 0.0 if (t <= -5.8e+134) tmp = t_1; elseif (t <= 1e+76) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * (-1.0 + (z / t))); tmp = 0.0; if (t <= -5.8e+134) tmp = t_1; elseif (t <= 1e+76) tmp = x + ((y * z) / (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[(-1.0 + N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e+134], t$95$1, If[LessEqual[t, 1e+76], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \left(-1 + \frac{z}{t}\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 10^{+76}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.80000000000000023e134 or 1e76 < t Initial program 69.3%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6496.7%
Simplified96.7%
if -5.80000000000000023e134 < t < 1e76Initial program 93.8%
Taylor expanded in z around inf
*-lowering-*.f6486.8%
Simplified86.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.8e+134) (+ x y) (if (<= t 2.7e+74) (+ x (/ (* y z) (- a t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.8e+134) {
tmp = x + y;
} else if (t <= 2.7e+74) {
tmp = x + ((y * z) / (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 <= (-5.8d+134)) then
tmp = x + y
else if (t <= 2.7d+74) then
tmp = x + ((y * z) / (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 <= -5.8e+134) {
tmp = x + y;
} else if (t <= 2.7e+74) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.8e+134: tmp = x + y elif t <= 2.7e+74: tmp = x + ((y * z) / (a - t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.8e+134) tmp = Float64(x + y); elseif (t <= 2.7e+74) tmp = Float64(x + Float64(Float64(y * z) / 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 <= -5.8e+134) tmp = x + y; elseif (t <= 2.7e+74) tmp = x + ((y * z) / (a - t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.8e+134], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.7e+74], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+134}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+74}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -5.80000000000000023e134 or 2.6999999999999998e74 < t Initial program 69.3%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6492.4%
Simplified92.4%
if -5.80000000000000023e134 < t < 2.6999999999999998e74Initial program 93.8%
Taylor expanded in z around inf
*-lowering-*.f6486.8%
Simplified86.8%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.7e+151) (+ x y) (if (<= t 4.4e+53) (+ x (/ y (/ a (- z t)))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7e+151) {
tmp = x + y;
} else if (t <= 4.4e+53) {
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 <= (-2.7d+151)) then
tmp = x + y
else if (t <= 4.4d+53) 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 <= -2.7e+151) {
tmp = x + y;
} else if (t <= 4.4e+53) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.7e+151: tmp = x + y elif t <= 4.4e+53: tmp = x + (y / (a / (z - t))) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.7e+151) tmp = Float64(x + y); elseif (t <= 4.4e+53) 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 <= -2.7e+151) tmp = x + y; elseif (t <= 4.4e+53) tmp = x + (y / (a / (z - t))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7e+151], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.4e+53], 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 -2.7 \cdot 10^{+151}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+53}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.7000000000000001e151 or 4.39999999999999997e53 < t Initial program 71.8%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6491.6%
Simplified91.6%
if -2.7000000000000001e151 < t < 4.39999999999999997e53Initial program 93.0%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.6%
Applied egg-rr95.6%
Taylor expanded in a around inf
/-lowering-/.f64N/A
--lowering--.f6484.0%
Simplified84.0%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.7e+151) (+ x y) (if (<= t 8.5e+52) (+ x (* y (/ (- z t) a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7e+151) {
tmp = x + y;
} else if (t <= 8.5e+52) {
tmp = x + (y * ((z - 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 <= (-2.7d+151)) then
tmp = x + y
else if (t <= 8.5d+52) then
tmp = x + (y * ((z - 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 <= -2.7e+151) {
tmp = x + y;
} else if (t <= 8.5e+52) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.7e+151: tmp = x + y elif t <= 8.5e+52: tmp = x + (y * ((z - t) / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.7e+151) tmp = Float64(x + y); elseif (t <= 8.5e+52) tmp = Float64(x + Float64(y * Float64(Float64(z - 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 <= -2.7e+151) tmp = x + y; elseif (t <= 8.5e+52) tmp = x + (y * ((z - t) / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7e+151], N[(x + y), $MachinePrecision], If[LessEqual[t, 8.5e+52], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+151}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+52}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.7000000000000001e151 or 8.49999999999999994e52 < t Initial program 71.8%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6491.6%
Simplified91.6%
if -2.7000000000000001e151 < t < 8.49999999999999994e52Initial program 93.0%
Taylor expanded in a around inf
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6483.7%
Simplified83.7%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.36e+114) (+ x y) (if (<= t 4.2e+72) (+ x (/ y (/ a z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.36e+114) {
tmp = x + y;
} else if (t <= 4.2e+72) {
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 <= (-1.36d+114)) then
tmp = x + y
else if (t <= 4.2d+72) 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 <= -1.36e+114) {
tmp = x + y;
} else if (t <= 4.2e+72) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.36e+114: tmp = x + y elif t <= 4.2e+72: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.36e+114) tmp = Float64(x + y); elseif (t <= 4.2e+72) 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 <= -1.36e+114) tmp = x + y; elseif (t <= 4.2e+72) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.36e+114], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.2e+72], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.36 \cdot 10^{+114}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+72}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.36000000000000008e114 or 4.2000000000000003e72 < t Initial program 69.3%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6490.5%
Simplified90.5%
if -1.36000000000000008e114 < t < 4.2000000000000003e72Initial program 94.2%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.7%
Applied egg-rr95.7%
Taylor expanded in t around 0
/-lowering-/.f6480.0%
Simplified80.0%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.8e+134) (+ x y) (if (<= t 5e+52) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.8e+134) {
tmp = x + y;
} else if (t <= 5e+52) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-5.8d+134)) then
tmp = x + y
else if (t <= 5d+52) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.8e+134) {
tmp = x + y;
} else if (t <= 5e+52) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.8e+134: tmp = x + y elif t <= 5e+52: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.8e+134) tmp = Float64(x + y); elseif (t <= 5e+52) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.8e+134) tmp = x + y; elseif (t <= 5e+52) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.8e+134], N[(x + y), $MachinePrecision], If[LessEqual[t, 5e+52], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+134}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+52}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -5.80000000000000023e134 or 5e52 < t Initial program 70.9%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6490.0%
Simplified90.0%
if -5.80000000000000023e134 < t < 5e52Initial program 94.0%
Taylor expanded in x around inf
Simplified61.7%
Final simplification72.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.1e+197) y (if (<= y 4.1e+197) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.1e+197) {
tmp = y;
} else if (y <= 4.1e+197) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-1.1d+197)) then
tmp = y
else if (y <= 4.1d+197) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.1e+197) {
tmp = y;
} else if (y <= 4.1e+197) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.1e+197: tmp = y elif y <= 4.1e+197: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.1e+197) tmp = y; elseif (y <= 4.1e+197) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.1e+197) tmp = y; elseif (y <= 4.1e+197) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.1e+197], y, If[LessEqual[y, 4.1e+197], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+197}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+197}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.09999999999999995e197 or 4.1000000000000003e197 < y Initial program 54.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6452.2%
Simplified52.2%
Taylor expanded in t around inf
Simplified29.8%
if -1.09999999999999995e197 < y < 4.1000000000000003e197Initial program 92.6%
Taylor expanded in x around inf
Simplified69.3%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 85.5%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.4%
Applied egg-rr96.4%
Final simplification96.4%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.5%
Taylor expanded in x around inf
Simplified57.8%
(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}
herbie shell --seed 2024161
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))