// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class RelaxedOrStrict {
    public static class Relaxed {
        public double calc(double v) {
            return Math.sqrt(Math.cos(v) * Math.cos(v) + Math.sin(v) * Math.sin(v));
        }
    }
    public static strictfp class Strict { // strictfp is default and keywod obsolete from Java 17+
        public double calc(double v) {
            return StrictMath.sqrt(StrictMath.cos(v) * StrictMath.cos(v) + StrictMath.sin(v) * StrictMath.sin(v));
        }
    }
    public static void main(String[] args) {
        Relaxed o1 = new Relaxed();
        Strict o2 = new Strict();
        for(int i = 0; i < 10; i++) {
            System.out.printf("%d : %.6f %.6f\n", i, o1.calc(i), o2.calc(i));
        }
    }
}
